//下面定义的方法可以放在 (function (){}())的外面
//也可以放在它的里面
function onError(jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
(function () {
'use strict';
// function onError(jqXHR, textStatus, errorThrown) {
// console.log(jqXHR);
// console.log(textStatus);
// console.log(errorThrown);
// }
$.ajax({
url: '
http://my.drupal7serverice.com//drupal7/myservice/node/10000',
type: 'GET',
dataType: 'json',
error: onError,
success: function (data) {
console.log(data);
}
});
}());