UPDATE 1:
This is what I get in the browser if I type
http://www.remote_host.com/feed.php?callback=jsonpCallBack
{ "rss": { "channels": [ { "title": "title goes here", "link": "http://www.remote_server.com/feed.php", "description": "description goes here", "items": [ { "title": "item title goes here", "link": "item link goes here", "pubDate": "item date goes here", "description": "item description goes here" }, { "title": "item title goes here", "link": "item link goes here", "pubDate": "item date goes here", "description": "item description goes here" }, { "title": "item title goes here", "link": "item link goes here", "pubDate": "item date goes here", "description": "item description goes here" } ] } ] } }
So this is not jsonp?
ORIGINAL QUESTION:
I have the following script where I am trying to get json data from a remote host:
$(document).ready(function() { get_json_feed(); function get_json_feed() { $.ajax({ url: 'http://www.remote_host.com/feed.php?type=json', type: 'GET', dataType: 'jsonp', error: function(xhr, status, error) { alert("error"); }, success: function(json) { alert("success"); } }); } });
But for some reason, I get an error and warning:
Note: the resource is interpreted as a script, but is transmitted with the MIME type text / HTML.
Error: does not throw SyntaxError: Unexpected token:
What am I doing wrong?
source share