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.
精彩评论