Entry
Which browsers support JavaScript entities?
Are HTML Script Macros supported by any browser?
Mar 2nd, 2000 01:44
Martin Honnen,
NN3+ supports so called JavaScript entities as the value of an HTML
attribute:
<TAGNAME ATTRIBUTENAME="&{js code here};">
for instance
<SCRIPT>
var today = new Date().toString()
</SCRIPT>
<INPUT VALUE="&{today};">
JavaScript entities seem to be what
http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.7
calls Script Macro.
Unfortunately IE3-5 don't support this handy way of dynamically setting
HTML attribute values. So for cross browser code you are forced to use
document.write e.g.
<SCRIPT>
document.write('<INPUT VALUE="' + today + '">');
</SCRIPT>