JavaScript Equivalent Of PHP __call

前端 未结 5 1372
一生所求
一生所求 2020-12-05 09:55

In PHP you can detect when a method is called even when it doesn\'t exist using the \"magic\" __call function.

public function __call($methodNam         


        
5条回答
  •  猫巷女王i
    2020-12-05 10:42

    Obsolete since Gecko 43 (Firefox 43 / Thunderbird 43 / SeaMonkey 2.40)

    You can use __noSuchMethod__ in Firefox. Unfortunately it is non standard...

    Related question : Is there an equivalent of the __noSuchMethod__ feature for properties, or a way to implement it in JS?

提交回复
热议问题