我遇到了一个需要内置功能的问题和解决方案mootools
。所以我开始解剖它。有一个我对它感兴趣的
IframeShim.destroy
功能
destroy: function(){
if (this.shim) this.shim.destroy();
return this;
}
现在我无法理解这是什么shim
。特别是我想了解的是
Request.JSONP.cancel
它的代码是这样的
cancel: function(){
if (this.running) this.clear().fireEvent('cancel');
return this;
}
现在这个取消调用clear
其代码是这样的
clear: function(){
this.running = false;
if (this.script){
this.script.destroy();
this.script = null;
}
return this;
}
现在在这个清晰的功能中,我可以看到destroy()
哪个带我去shim
(见顶部的代码)并且我卡住了。所有这些功能都在mootools-more.js
帮助?
如果有人可以提供一个普通的 JavaScript 实现,那就太好了。Request.JSONP.cancel
它有JQuery
替代方案吗?