javascript - basic import.io html search -
so if of have experience scraping or particularly import.io help, since import.io i'm using... although think question js really...
i want connect basic html input import.io js code can have custom search
"input": { var search_name = document.getelementsbyname("search_name").value; "search_name": search_name } <input name="search_name" placeholder="doesnt work :(">
heres go... basic working import.io js example. tried add variable input name , add variable search item alone isnt working...
i contacted import.io team , said try make easier tutorial in future try @ particle example have include input search example big me deconstruct see how input works.
heres particle example uploaded server can see working although bit slow-> http://www.originalengine.com/scrape/
please find here modified version of code seems produce correct result: http://jsfiddle.net/znsbk/
this modified function:
var dotestquery = function() { // query tile mytestscrape2 var search_name = document.getelementbyid("myinput").value; console.error(search_name); importio.query({ "connectorguids": [ "a2201b40-7acc-4a3d-a3ed-30e71e018ffa" ], "input": { "search_name": search_name } }, { "data": datacallback, "done": donecallback }); }
steps took working (not may required summary of playing with):
- redefined function called submit there's no possible collision 1 defined in script
- moved creation of "search_name" variable out of json argument importio.query
- assigned id input , used
getelementbyid
rather using name (as return array)
Comments
Post a Comment