1. Do an "echo" in the JS function definition:
function myJavascriptFunction() {
var foo = <?php echo $somePhpVariable ?>;
}
2. Assign the PHP variable to a HIDDEN <FORM> element, then access this from
JS:
<INPUT TYPE="HIDDEN" NAME="somePhpVariable" VALUE="<?php echo
$somePhpVariable ?>">
function myJavascriptFunction () {
var foo = document.forms[0].somePhpVariable.value;
}
Kirk
-----Original Message-----
I'm in the need to fetch some javascript varibles from php, any ideas on
how this
could be done ?
Regards, Morten Hansen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]