I have a JavaScript file (extension .js, not .html) containing several JavaScript functions.
I want to call one of the PHP functions in a PHP file containing only several PHP functions from within one of the JavaScript functions.
- Is that possible?
- Would I need to "include" the
.phpfile containing the PHP function in the.jsfile? - How would I do that?
For example, say I had a file called myLib.php containing a function calledmyFuncthat takes two parameters (param1andparam2). Then I have a.jsfile containing a function calledmyJsFunc. How would a call themyFunc(PHP) from within themyJsFunc(JavaScript function)? Wouldn't I need to include the PHP file somehow in the.jsfile?