I am using the following on an image
image.addEventListener("load",imageLoaded,false);
Is this the same as
image.onLoad = function(){
imageLoaded();
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The second one should be
onloadinstead ofonLoad. If you’re asking if they’ll both invoke the handler when the image is loaded, then yes.If there are no additional arguments to pass, you could shorten the second one…
A key difference is that you can bind multiple handlers using
addEventListener, but just one withonload.