Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (25 sloc) 0.854 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?xml version="1.0"?>
<entry type="method" name="jQuery.globalEval" return="">
  <title>jQuery.globalEval()</title>
  <signature>
    <added>1.0.4</added>
    <argument name="code" type="String">
      <desc>The JavaScript code to execute.</desc>
    </argument>
  </signature>
  <desc>Execute some JavaScript code globally.</desc>
  <longdesc>
    <p>This method behaves differently from using a normal JavaScript <code>eval()</code> in that it's executed within the global context (which is important for loading external scripts dynamically).</p>
  </longdesc>
  <example>
    <desc>Execute a script in the global context.</desc>
    <code><![CDATA[function test(){
jQuery.globalEval("var newVar = true;")
}
test();
// newVar === true
]]></code>
  </example>
  <category slug="utilities"/>
  <category slug="version/1.0.4"/>
</entry>
Something went wrong with that request. Please try again.