JS callback function is very simple, look at the code:
In a.js
var myback = null; function load(obj){ myback = obj; } function save(){ // 后台请求 $.ajax.post...... // 调用回调函数 myback(); }
Call in b.js
// 就是把要回调的函数当成参数传递过去! load(function(){ this.hide(); })