Possible Duplicate:
JSONP request: “Resource interpreted as Script but transferred with MIME type text/html”
Anyone can let me know what am I doing wrong here will be appreciated.
This is the code with json file on local URL / localhost. And this work with no problem
(function() {
var json_url = 'http://localhost:8888/MOD/some-folder/app/mysql-to-json.php?page=index';
$.getJSON(json_url, function(data){
$.each(data, function(i, item) {
$('#state-list').append('<li><a href="display.html?state=' + item.d_state + '" data-transition="slide" rel="external">' + see_abbrv(item.d_state) + '</a></li>');
});
$('#state-list').listview('refresh');
});
}) ();
But when I do this, and I just updated the json_url to live url from json_url from localhost.
The data won't show up. And there is warning when I tried to inspect page:
Resource interpreted as Script but transferred with MIME type text/html: "http://www.live-server.com/app/mysql-to-json.php?page=index&callback=jQuery18201751285600475967_1360047415705&_=1360047415772".
updated code with live url:
(function() {
var json_url = 'http://www.live-server.com/app/mysql-to-json.php?page=index&callback=?';
$.getJSON(json_url, function(data){
$.each(data, function(i, item) {
$('#state-list').append('<li><a href="display.html?state=' + item.d_state + '" data-transition="slide" rel="external">' + see_abbrv(item.d_state) + '</a></li>');
});
$('#state-list').listview('refresh');
});
}) ();