jquery - Wikipedia API JSONP request blocked mime type mismatch -
i trying random pages wikipedia api using jsonp. in chrome , ie11 gives me url name "was blocked due mime type mismatch".
here jsonp request.
$.ajax({ url: "https://en.wikipedia.org/w/api.php?action=query&list=random&rnlimit=5", jsonp: "callback", datatype: "jsonp", format: "json", success: function( data ) { console.log( data ); } });
if paste url in browser , check html response find instructions in there. have add format=json query string parameter.
try following ajax call:
$.ajax({ url: "https://en.wikipedia.org/w/api.php?action=query&list=random&rnlimit=5&format=json", datatype: "jsonp", success: function( data ) { console.log( data ); } });
Comments
Post a Comment