欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Mozilla 表達式 __noSuchMethod__

 更新時間:2009年04月05日 00:40:55   作者:  
這是一個很特殊的方法,但是其存在的意義很大。不過很可惜只有firefox支持了。一個簡單的例子解釋一下它的用處



復(fù)制代碼 代碼如下:

//只能在firefox下運行
var test = {
name: "puterjam",
__noSuchMethod__: function(name, args){
alert(["Your call an error function [",name,"]. Arguments list: [",args,"]"].join(""));
}
}
test.hello();
test.helloWorld("china","shenzhen");

當(dāng)我們執(zhí)行了test對象里的某一個沒有定義的方法,就會自動執(zhí)行__noSuchMethod__方法,這樣我們可以利用他來作一些容錯和監(jiān)控的工作。

相關(guān)文章

最新評論