getJson

前端之家收集整理的这篇文章主要介绍了getJson前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
 
 

Deprecation Notice

The,andcallback methods introduced in jQuery 1.5 aredeprecated as of jQuery 1.8. To prepare your code for their eventual removal,use,andinstead.

// Assign handlers immediately after making the request,// and remember the jqxhr object for this requestvar jqxhr = $.getJSON( "example.json",function() {console.log( "success" );}).done(function() { console.log( "second success" ); }).fail(function() { console.log( "error" ); }).always(function() { console.log( "complete" ); });// perform other work here ...// Set another completion function for the request abovejqxhr.complete(function() { console.log( "second complete" ); });jqXHR.success()jqXHR.error()jqXHR.complete()jqXHR.done()jqXHR.fail()jqXHR.always()

猜你在找的Json相关文章