<spanclass="nv">CoffeeScript.require = </span><spanclass="nx">require</span></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-2">¶</a></div><p>Use standard JavaScript <code>eval</code> to eval code.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">CoffeeScript.eval = </span><spanclass="p">(</span><spanclass="nx">code</span><spanclass="p">,</span><spanclass="nx">options</span><spanclass="p">)</span><spanclass="o">-></span>
<spanclass="nb">eval</span><spanclass="nx">CoffeeScript</span><spanclass="p">.</span><spanclass="nx">compile</span><spanclass="nx">code</span><spanclass="p">,</span><spanclass="nx">options</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-3">¶</a></div><p>Running code does not provide access to this scope.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">CoffeeScript.run = </span><spanclass="p">(</span><spanclass="nx">code</span><spanclass="p">,</span><spanclass="nv">options = </span><spanclass="p">{})</span><spanclass="o">-></span>
<spanclass="nb">Function</span><spanclass="p">(</span><spanclass="nx">CoffeeScript</span><spanclass="p">.</span><spanclass="nx">compile</span><spanclass="nx">code</span><spanclass="p">,</span><spanclass="nx">options</span><spanclass="p">)()</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-4">¶</a></div><p>If we're not in a browser environment, we're finished with the public API.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="k">return</span><spanclass="nx">unless</span><spanclass="nb">window</span><spanclass="o">?</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-5">¶</a></div><p>Load a remote script from the current domain via XHR.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">CoffeeScript.load = </span><spanclass="p">(</span><spanclass="nx">url</span><spanclass="p">,</span><spanclass="nx">callback</span><spanclass="p">)</span><spanclass="o">-></span>
<spanclass="nx">xhr</span><spanclass="p">.</span><spanclass="nx">send</span><spanclass="kc">null</span></pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-6">¶</a></div><p>Activate CoffeeScript in the browser by having it compile and evaluate
<spanclass="kc">null</span></pre></div></td></tr><trid="section-7"><tdclass="docs"><divclass="pilwrap"><aclass="pilcrow"href="#section-7">¶</a></div><p>Listen for window load, both in browsers and in IE.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="k">if</span><spanclass="nb">window</span><spanclass="p">.</span><spanclass="nx">addEventListener</span>