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()

相关文章

AJAX是一种基于JavaScript和XML的技术,能够使网页实现异步交...
在网页开发中,我们常常需要通过Ajax从后端获取数据并在页面...
在前端开发中,经常需要循环JSON对象数组进行数据操作。使用...
AJAX(Asynchronous JavaScript and XML)是一种用于创建 We...
AJAX技术被广泛应用于现代Web开发,它可以在无需重新加载页面...
Ajax是一种通过JavaScript和HTTP请求交互的技术,可以实现无...