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

Mozilla 表達(dá)式 __noSuchMethod__

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



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

//只能在firefox下運(yùn)行
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對(duì)象里的某一個(gè)沒有定義的方法,就會(huì)自動(dòng)執(zhí)行__noSuchMethod__方法,這樣我們可以利用他來作一些容錯(cuò)和監(jiān)控的工作。

相關(guān)文章

最新評(píng)論