Re: Attach Events to elements dynamically created by JavaScript in IE using MSHTML
Can you post a link to a page that you are having a problem with?
AliR.
<phughes31@gmail.com> wrote in message
news:1194284713.380910.9010@50g2000hsm.googlegroups.com...
Hi,
I am writing an browser helper object that is used to detect clicks on
web page elements (e.g. links). During the DocumentComplete event, I
get a list of all the elements and attach events to them via the
IHTMLElement2::attachEvent method. This works fine for most pages.
However there are some pages where some of these elements may get
created by the javascript code on the web page. This will then
typically take place after the DocumentComplete event has fired. Since
these elements are created after the DocumentComplete event was fired,
the attachEvent method will not have been called for these new
elements. Does IE generate any event when a new element is created so
that I can use the attachEvent on the element? Is there some other way
to know when an element was created? Is there any other way to achieve
what I am trying to do?
Thanks in advance,
-Pascal