Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.