开发者

Dependent method registration | Element i.d. availability

How can one register event handlers to eleme开发者_JS百科nts that are currently loaded into the DOM?


Just test them for existence first:

var signup, signin, bookmark;
if(signup = document.getElementById('signup'))
    signup.onclick = interface_signup;
...

etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜