ginerjm Posted April 1, 2011 Share Posted April 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
requinix Posted April 1, 2011 Share Posted April 1, 2011 JavaScript uses a + to concatenate strings together... Quote Link to comment Share on other sites More sharing options...
.josh Posted April 1, 2011 Share Posted April 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.