I am using jQuery, jQuery-UI auto complete along with this link as a source
https:
here is my code:
$("#searchinput").autocomplete({ source: function (request, response) { var q=request.term; $.ajax({ type: "GET", // url: "http://d.yimg.com/autoc.finance.yahoo.com/autoc", for http use only url: "https://www.google.com/finance/match?matchtype=matchall", data: {q: q}, dataType: "jsonp", contentType: 'application/json; charset=utf-8', jsonp : "callback", jsonpCallback: "callback", }); // call back function callback = function (data) { var suggestions = []; //alert(JSON.stringify(data.matches)); $.each(data.matches, function(i, val) { suggestions.push("Name:"+ val.n+" #Symbol:"+val.t+" #Exchange:"+val.e); }); response(suggestions); } }, minLength: 1, select: function (event, ui) { $("#searchinput").val(ui.item.value.split("#")[0]); }, });
I get the following error
Uncaught SyntaxError: Unexpected token:
here you can see the error image: http://i.stack.imgur.com/NYMPG.jpg
source share