One can parameterize HTML using document.writeln()
|
commands such as:
|
document.writeln("str1" + JSvariable + "str2");
|
Another way of achieving this is by directly embedding the variable into the HTML, requiring no <SCRIPT> tag and no document.write():
|
<IMG WIDTH="&{JSvar1};" SRC="&{JSvar2};">
|
where JSvar1 and JSvar2 are JavaScript variables
|
Syntax is modeled after HTML special characters: for example, > produces a literal greater than sign (>)
|
Such JavaScript entities can ONLY appear on the right-hand side of attribute value pairs
-
Cannot appear in arbitrary HTML text such as titles
-
The document.writeln approach has no such restriction!
|