Click to See Complete Forum and Search --> : Calling jscript function


anub
05-01-2006, 06:03 AM
1. How i can call a jscript function from PHP?
2. How i can pass a php variable value to a javascript function?

ava
05-01-2006, 08:38 AM
1. How i can call a jscript function from PHP?
You can't. PHP is server based and Jscript is client-based.
You can, of course, use event handlers, but they won't execute until the page is entirely built.

2. How i can pass a php variable value to a javascript function?
This is possible in the jscript code. I'll give an example.
jsvar = '<?PHP echo $phpvar ?>'
Note that the other way around is not possible this way.

felgall
05-01-2006, 05:06 PM
To pass information from Javascript to PHP (after the web page has loaded) you can use Ajax.

coeus
05-01-2006, 05:16 PM
Yes, and there are also AJAX-PHP frameworks available. Just google Ajax php frameworks

anub
05-01-2006, 11:06 PM
thank u.