Reply to comment

Problem in calling events other than onload

Thanks for this very informative article.
I need to call keydown event on iframe but whatever eventlistener i attache to the iframe, its calling the function on load of iframe only. My code is:
fullIframe.contentWindow.document.attachEvent("onkeydown",myfunc());
but myfunc() is getting called when my page is loading. Can you help??

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options