Call JavaScript Function From PHP Script Using jQuery getScript
<p>I'm very new to jQuery &amp; web development in general. I'm attempting to use jQuery's ".getScript()" method to load a couple JavaScript scripts that are written in a particular PHP file, but I think I'm missing something. 
(<b>NOTE:</b> I noticed several different questions that looked like they had the potential to help me, but none did. If there's one you know of, feel free to point me in that direction. Thanks.)</p>

<p>When I debug this in Firebug it hits the ".getScript()" call &amp; then jumps on to the next line, seemingly without executing.<br>
Here's how I'm trying to do it:</p>

<pre><code>jQuery.getScript("relative/path/to/script/phpScript.php", function(){
    alert("I'm HERE!");
    setValues(); // JavaScript function that's written by phpScript.php
});
</code></pre>

<p>In this case, the JavaScript is being generated by the "phpScript.php" file and my "alert()" never gets run, but I'm not sure why. Any ideas?<br>
I did notice that I'm getting some kind of parse error by following a suggestion in another question. I don't know how to resolve that. Here's the code for that:</p>

<pre><code>jQuery(document).ajaxError(function(event, request, settings){
      alert('error loading: ' + request.status + "\nevent: "+ event);
      for (var key in request){
          if (request.hasOwnProperty(key)) {
              alert(key + " -&gt; " + request[key]);
          }
     }
});
</code></pre>

<p>BTW, we're running jQuery with "jQuery.noConflict();" set, which is why I'm not using the shorthand "$()" notation.</p>

<p>Here is a snippet from the response body from the GET call in getScript():   </p>

<pre><code>&lt;html&gt;&lt;script type="text/javascript"&gt;
function setValues()
    jQuery("#formname").text(window.formNAME);
    jQuery("#Form_Path").text(window.formPATH);
    jQuery("#Form_DB").text(window.formDB);
    jQuery('#pertaining_to').text(window.pertainNAME);
    jQuery("#Pertain_To_ID").text(window.pertainID);
    jQuery("#Form_ID").text(window.formID);
    jQuery("#Field_ID").text(window.fieldName);
}
&lt;/script&gt;

&lt;head&gt;
</code></pre>

<p>Thanks in advance,<br>
-Mark</p>
