Basic HTML version of Foils prepared 3 March 99

Foil 29 JavaScript Entities

From Overview of JavaScript I -- Basic Web Scripting Language CPS616 Technologies of the Information Age -- Spring Semester 99. by Geoffrey C. Fox (Tom Scavo)

JavaScript Entity
1 One can parameterize HTML using document.write(ln) commands such as:
2 document.writeln("string1" + Jsvariable + "string2");// etc.
3 There is another way of achieving this without a <SCRIPT> tag and no document.writeln -- namely
4 <IMG width="&{JSvar1};" src="&{JSvar2}" >
5 where JSvar1 and JSvar2 are JavaScript variables holding width and URL of image
6 Syntax is modeled on that for special characters where
  • > is > etc.
7 Such JavaScript Entities can only appear on right hand side of attributes values and cannot appear in HTML text such as titles
  • document.writeln approach has no such restriction!

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Mar 3 1999