Connecting Tech Pros Worldwide Help | Site Map

FAQ Topic - How do I get a perl/asp/php variable into client-side js? (2008-08-30)

FAQ server
Guest
 
Posts: n/a
#1: Aug 30 '08
-----------------------------------------------------------------------
FAQ Topic - How do I get a perl/asp/php variable into
client-side js?
-----------------------------------------------------------------------

Use the server-side language to generate the javascript:

var jsvar="<%= aspvar %>";
var jsvar="<?php echo $phpvar ?>";


--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by http://www.pair.com.

Evertjan.
Guest
 
Posts: n/a
#2: Aug 30 '08

re: FAQ Topic - How do I get a perl/asp/php variable into client-side js? (2008-08-30)


FAQ server wrote on 30 aug 2008 in comp.lang.javascript:
Quote:
-----------------------------------------------------------------------
FAQ Topic - How do I get a perl/asp/php variable into
client-side js?
-----------------------------------------------------------------------
>
Use the server-side language to generate the javascript:
>
var jsvar="<%= aspvar %>";
var jsvar="<?php echo $phpvar ?>";
Only if the variables do not contain a " or a new line.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Closed Thread