3
我想包裝Prototype Ajax.Request以模擬AJAX延遲。我的意思是,使用封閉和原型的延遲()的設施,但顯然有什麼錯我的代碼模擬AJAX延遲與包裝封閉
/*
* Purpose: simulate AJAX latency when developing on localhost
* What's wrong?
*/
Ajax.Request = (function(original) {
return function(url, options) {
return original.delay(1, url, options);
};
}) (Ajax.Request);