By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

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

P: n/a
-----------------------------------------------------------------------
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.

Aug 29 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
FAQ server wrote on 30 aug 2008 in comp.lang.javascript:
-----------------------------------------------------------------------
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)
Aug 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.