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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -