in reply to Re: Re: HTML tags in perl CGI scripts
in thread HTML tags in perl CGI scripts
In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
It also recommends including the quotes. For one thing, XML requires quotation marks and always including quotes will make code easier to transition to XHTML.
It is dangerous to leave out the quotes when interpolating a variable. Someone in the future might try to put a space (or a quote) in the variable. Browsers try to deal with broken markup but it is wise not to abuse the browser. Anyone leaving out the quotes because they haven't had a problem yet is going to be scratching their head in the future wondering why their HTML isn't working on some other browser or made an unrelated change in the code.
|
---|