title: Callback function in dojo.io.script.get
body: <p>I am trying to get some JSON from an external url. This works fine with the twitter request in the example in the dojo documentation.</p>
  
  <p>I guess the problem comes with the callback function, as I'm not sure if I need one and where to place it.</p>
  
  <p>The JSON looks like:</p>
  
  <pre><code>{"upcoming":[]}
  </code></pre>
  
  <p>and that's how I call it:</p>
  
  <pre><code>     function getJSON(){
     // Look up the node we'll stick the text under.
     var targetNode = dojo.byId("results");
  
     // The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
     var jsonpArgs = {
       url: url,
       load: function(data){
           console.log(data);
         // Set the data from the search into the viewbox in nicely formatted JSON
         targetNode.innerHTML = "&lt;pre&gt;" + dojo.toJson(data, true) + "&lt;/pre&gt;";
       },
       error: function(error){
         targetNode.innerHTML = "An unexpected error occurred: " + error;
       }
     };
     test = dojo.io.script.get(jsonpArgs);
   }
   dojo.ready(getJSON);
  </code></pre>
  
  <p>ant that's the output I get:</p>
  
  <pre><code>JSON:
  {
      "returnValue": true,
      "timeStamp": 1332858447300,
      "eventPhase": 0,
      "target": null,
      "defaultPrevented": false,
      "srcElement": null,
      "type": "load",
      "cancelable": false,
      "currentTarget": null,
      "bubbles": false,
      "cancelBubble": false
  }
  </code></pre>