javascript - parsing results of import.io search to table -
have set several sites i'd search, created page in javascript allow me input value , search multiple connectors, want find better way display results. currently, results separated line break. ideally, results in table clickable links , name of source database added 1 sees when running search in import.io program itself. current code below. appreciated!
<!doctype html> <html> <head> <title>canton search 5000</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- 1. include client library --> <script src="https://cdn.import.io/js/2.0.0/importio.js"></script> <!-- 2. configure library --> <script type="text/javascript"> importio.init({ "auth": { "userguid": "3969d665-a06a-4738-9d1a-d691589d5f77", "apikey": "cfknykjp/dd5ee9ruue2dwa/cnrmlli2ibhqzs95zul6v4culdq7c1wshlyo9ed6csrrgbj4gp/y72vajpxeza==" }, "host": "import.io" }); // data , done callbacks var datacallback = function(data) { console.log("data received", data); (var = 0; < data.length; i++) { var d = data[i]; (var k in d.data) { document.write("<i>" + k + "</i>: " + d.data[k] + "<br />"); } document.write("<hr>"); } } var donecallback = function(data) { console.log("done, data:", data); document.write("<b>done</b><hr>"); } // 3. query (when function called) var doquery = function() { var firstinputquery = document.getelementbyid("name").value; // query tile warrants importio.query({ "connectorguids": [ "1e5989be-bcc3-4d29-91fd-003f8a603da9", "e1282ac5-8a98-4848-a907-9a0719ea51aa", "5e3e9f4b-d7f0-4b24-b646-62455cb2f174" ], "input": { "name": firstinputquery, } }, { "data": datacallback, "done": donecallback }); } window.onload = function(){ document.getelementbyid("unselectall").onchange = function() {check(document.myform)}; }; </script> <body> <p> name: <input type="text" id="name" placeholder="enter name here"> <p><tr> </form> <br><button onclick="doquery()">search them cantons</button> </body> </html>
Comments
Post a Comment