RE: [PHP] PHP / JavaScript integration

From: Date: Wed, 09 Mar 2005 02:20:41 +0000
Subject: RE: [PHP] PHP / JavaScript integration
Groups: php.general 
Request: Send a blank email to php-general+get-210276@lists.php.net to get a copy of this message
Mário Gamito <mailto:lists@tuxdoit.com> on Tuesday, March 08, 2005 4:28 PM said: > I'm trying to integrate some JavaScript functions in PHP, but so far, > no good :( [snip] > Now... i want to call this JavaScript function from the regular PHP > files. In particular, before the HTML code. > Like this: [snip] > How can i do this ? > How to tell PHP, that def(word) is a JS function in js.php file ? > I've tried include ('js.php'), etc., but got no results :( You don't and you can't. PHP does not interact with the client (like you are thinking it does) and Javascript does not interact with the server. They are completely different and not related, except that PHP can send Javascript to the client for the client to interpret. It's a bit confusing at first but once you understand it, you'll wonder why it ever didn't make sense. Chris.

« previous php.general (#210276) next »