3

シンプルな import.io を JavaScript (サンプル Web サイト) と統合しようとしていますが、スクリプトが機能しません。手伝って頂けますか?

  <!DOCTYPE html>   <html> <head>   <title>Import&bull;io
 Example</title>   <script
 src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 <!-- 1. Include the client library -->   <script
 src="https://cdn.import.io/js/2.0.0/importio.js"></script>

 <!-- 2. Configure the library -->   <script type="text/javascript">
     importio.init({
       "auth": {
        "userGuid": "XXX",
         "apiKey": "XXX"
       },
       "host": "import.io"
     });

     // Data and done callbacks
     var dataCallback = function(data) {
       console.log("Data received", data);
       for (var i = 0; i < data.length; i++) {
        var d = data[i];        for (var k in d.data) {
          document.write("<i>" + k + "</i>: " + d.data[k] + "<br />");      }       document.write("<hr>");       }
     }
     var doneCallback = function(data) {
       console.log("Done, all data:", data);
       document.write("<b>Done</b><hr>");
     }

 // 3. Do the query (when the function is called)
     var doQuery = function() {
       // Query for tile Magic Api
       importio.query({
         "connectorGuids": [
           "a362c175-e265-4f96-867c-5610686bbb21"
         ],
         "input": {
           "webpage/url": "http://www.davy.ie/markets-and-share-prices/iseq"
         }
       }, { "data": dataCallback, "done": doneCallback });
     }   </script>   <body>
     <button onclick="doQuery()">Query</button>   </body> </html>
4

1 に答える 1