F
FAQ server
-----------------------------------------------------------------------
FAQ Topic - How do I get a jsp/php variable into
client-side javascript?
-----------------------------------------------------------------------
Use the server-side language to generate the javascript:
// JSP
var jsvar = "${ jspVar }";
// PHP
var jsvar = "<?php echo $phpVar ?>";
If an inline-script tag is used, the string must not contain any
markup-significant characters such as ` < `, ` > `, ` & `, ` ' ` or ` " `. Such
characters must be converted HTML entities on the server.
http://www.w3.org/TR/html4/sgml/entities.html
The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/
FAQ Topic - How do I get a jsp/php variable into
client-side javascript?
-----------------------------------------------------------------------
Use the server-side language to generate the javascript:
// JSP
var jsvar = "${ jspVar }";
// PHP
var jsvar = "<?php echo $phpVar ?>";
If an inline-script tag is used, the string must not contain any
markup-significant characters such as ` < `, ` > `, ` & `, ` ' ` or ` " `. Such
characters must be converted HTML entities on the server.
http://www.w3.org/TR/html4/sgml/entities.html
The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/