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. Link to comment https://forums.phpfreaks.com/topic/232448-calling-a-function/ Share on other sites More sharing options...
requinix Posted April 1, 2011 Share Posted April 1, 2011 JavaScript uses a + to concatenate strings together... Link to comment https://forums.phpfreaks.com/topic/232448-calling-a-function/#findComment-1195697 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. Link to comment https://forums.phpfreaks.com/topic/232448-calling-a-function/#findComment-1195713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.