Jump to content

calling a function?


ginerjm

Recommended Posts

I've never 'called' a function before, just used it as the target of an event ie, onclick="functionname".  I'm trying to do so in a little test php script to try out some stuff I got out of Resig's book.

 

in the html head section i have my script tag and the function

 

in the body i have some echo statements trying to output the results of a call to the function

 

echo 'paragraph contains'.getText("p1");

 

I get an undefined function error when I run this.  Is there some special syntax for 'calling' a js function?  I can't seem to find anything in the book on this.

Link to comment
https://forums.phpfreaks.com/topic/232448-calling-a-function/
Share on other sites

hmm looks more like you are trying to mix php with javascript...You cannot call javascript functions server-side.  PHP is parsed by the the PHP interpreter on the server.  Javascript is just arbitrary text to the server.  Javascript is parsed client-side by your browser.

Link to comment
https://forums.phpfreaks.com/topic/232448-calling-a-function/#findComment-1195713
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.