title: Java8, Nashorn: failed to load external .js script file
body: <p>I'm brand new to Nashorn and trying to load my first js file as follow:</p>
  
  <pre><code>public static void main(String[] args) {
          final ScriptEngineManager manager = new ScriptEngineManager();
          final ScriptEngine engine = manager.getEngineByName("nashorn");
  
          try {   
              engine.eval("load('https://cdn.jsdelivr.net/sockjs/1.0.3/sockjs.min.js')");
  
          }catch(final ScriptException e) {
              System.err.println(e);
          }
  
      }
  </code></pre>
  
  <p>I get the following Exception:</p>
  
  <pre><code>javax.script.ScriptException: TypeError: Cannot read property "prototype" from undefined in http://cdn.jsdelivr.net/sockjs/1.0.3/sockjs.min.js at line number 3
  </code></pre>
  
  <p>in addition, when I try to evaluate the following:</p>
  
  <pre><code>engine.eval("load('https://code.jquery.com/jquery-1.11.3.min.js')");
  </code></pre>
  
  <p>the eval() method doesn't return at all - it just stuck on debug (Using Eclipse).</p>
  
  <p>Any idea why prototype isn't defined, any why I cannot evaluate jquery js file?</p>
  
  <p>Thanks!</p>