Using values of variables from php page into javascript page
Moderator: General Moderators
Using values of variables from php page into javascript page
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?
Whats stoping you from delaring them in the php page as in
Does that help or is that not what you're asking?
Code: Select all
some_javascript variable = <?php echo($some_php_variable)?>