I get the message "Resource interpreted as a script, but transmitted with a MIME type message / json" using the Google Chrome JavaScript console.
The following code is currently running on my local computer:
var URL = "";
var YOUTUBE_ROOT = "http://gdata.youtube.com/feeds/api/videos?alt=jsonc&v=2";
var start_index = "&start-index=1";
var callback = "&jsonp=?"
function searchYouTube()
{
var q = encodeURIComponent(jQuery("#query").val());
var query = "&q="+q;
URL = YOUTUBE_ROOT+start_index+query+callback;
alert(URL);
$.getJSON(URL, function(data) {
$.each(data.items, function(i, item) {
alert(item);
});
});
}
jQuery(document).ready(function () {
jQuery("#searchYouTube").click(searchYouTube);
});
Can I find out what causes the error?
I tried using 'callback =?', 'Jsoncallback =?' for a callback, but everything results in the same error message.
Can I find out how to fix this?
Regards.
source
share