Asynchronous data received object ajax-

1.
$ OB load data
$ ob.load (url, data, function (d, status) {})

 


2.
$.get(url,data,callback,type)

 

3.
$.post(url,data,callback,type)

实例:
$.post('/demo02', data,
function (d) {
console.log(d)
$('#tip').text(d)
},
'json')


4.$.ajax({})


实例:
$.ajax({url: '/demo02',
type: 'post',
data: data,
dataType: 'json',
success: function (d) {
$('#tip').text(d)
console.log(d)
}
})


jquery cross-domain
code is:
$ .ajax ({
URL: 'XXX',
type: 'GET',
dataType: 'JSONP', designated as // domain access
jsonp: 'callback', // define the parameters of the callback name, so we get past the transfer callback function name
jsonpCallback: 'xxx' // callback function name of the definition jsonp
});

 

 

Guess you like

Origin www.cnblogs.com/chenlulu1122/p/11888927.html