How to replace loading a script file with an Ajax call in JavaScript (using YQL with JavaScript)
===

The following code goes out to YQL and fetches the current stock price of IBM (as an example). It works fine and does its task by loading a script file whose URL effectively causes the dynamic generation of JSON data, which upon loading and executing, causes 'top_stories' to be run and the price extracted. However, I would like to make this process based on an AJAX call ($.getJSON(..)) where I presume I separate out the url and data components from the below script-based example. I've tried a lot of variations without success--it doesn't seem like I can get the $.getJSON(..) call to call the callback function. Any thoughts would be appreciated.
...Eric

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
      <head><title>YQL</title>
       <style type='text/css'>
        #results{ width: 40%; margin-left: 30%; border: 1px solid gray; padding: 5px; height: 200px; overflow: auto; } 
      </style>
      <script type='text/javascript'>
      // Parses returned response 
      function top_stories(o) {
          var price = o.query.results.xml_api_reply.finance.last.data;
          alert("last = " + price);
          // Place price in div tag
          document.getElementById('results').innerHTML = price;
      }
    </script>
    </head>
    <body>
       <!-- Div tag for stories results -->
       <div id='results'></div>
       <!-- The YQL statment will be assigned to src. -->
       <script src="http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20google.igoogle.stock%20where%20stock%3D'ibm'%3B&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=top_stories"></script>   
     </body>
    </html>
