i want response below url using ajax/getjson method. http://randomvin.com/getajax.php?qry=random&str=random&fake=false problem javascript not letting me communicate above url not producing json. have tried datatype: 'jsonp' no luck. showing me
syntaxerror: expected expression, got '<'
1fmzu84pxyza75146
i know why showing me above error because response not in json in html! there has way, please suggest. in advance.
with jsonp, can read json responses. webpage linked to, gives html response, not json response. if have access server, can modify response to:
{"result": "1fmcu0gx0dub94477"} and use jsonp:
$.getjson('http://randomvin.com/getajax.php?qry=random&str=random&fake=false', function (data) { console.log(data.result); }); but if want read html response domain, way write own server side script sends request url , return data, , call server side script through ajax.
Comments
Post a Comment