Page 1 of 1

Using values of variables from php page into javascript page

Posted: Fri Aug 29, 2003 4:15 am
by agadgil
I am using some variables in my php script, as well I am using these variables in a .js page. Now these variables are not declared in the .js file(hence I get an error whenever my code for php wants to execute such a .js page). The variables are used in the .php file and that I need to use the value of these variables in my .js script. Any idea how I can do this?

Posted: Fri Aug 29, 2003 4:45 am
by fallen
Whats stoping you from delaring them in the php page as in

Code: Select all

some_javascript variable = <?php echo($some_php_variable)?>
Does that help or is that not what you're asking?