欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

定义方法 放的位置

shiping1 的头像
//下面定义的方法可以放在 (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);
        }
    });
}());
普通分类: