Event generated when insertAdjacentHTML is executed

D

dexter

hi everyone,
I am writing an extension to a third party application. this
application generates code dynamically using insertAdjacentHTML(). I
want to execute my function whenever the insertAdjacentHTML is called.
Does insertAdjacentHTML() fire any event that i can handle and execute
my function? or is there any other solution?
Thanxs in advance
 
T

Thomas 'PointedEars' Lahn

dexter said:
I am writing an extension to a third party application. this
application generates code dynamically using insertAdjacentHTML().

IE only. Look into createElement(), createTextNode() and appendChild()
for a standards compliant approach.
I want to execute my function whenever the insertAdjacentHTML is called.
Does insertAdjacentHTML() fire any event that i can handle
and execute my function?

In IE, maybe you can use the `onload' or `onreadystatechange' event
handlers:
<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onload.asp>
or is there any other solution?

There is always a solution different from this, usually a better one.
What exactly that would be depends on you: your knowledge, your environment
aso.


PointedEars
 
V

VK

dexter said:
hi everyone,
I am writing an extension to a third party application. this
application generates code dynamically using insertAdjacentHTML(). I
want to execute my function whenever the insertAdjacentHTML is called.
Does insertAdjacentHTML() fire any event that i can handle and execute
my function? or is there any other solution?
Thanxs in advance

Everything below is naturally IE only and exclusively:

insertAdjacentHTML seems to fire an "abstrasted" propertychange event:-
instead of a real property name event.propertyName returns event
handler name "onpropertychange". It seems like the system feels that
something is changed but not sure yet what exactly. One can use it on
its own risk like:
....
document.body.onpropertychange = f1;
....
function f1() {
if ((event.propertyName == 'onpropertychange') &&
(event.srcElement.tagName == 'BODY')) {
// someone is playing with insertAdjacentHTML
}
}

Again: it seems like a undocumented feature rather than something you
can completely trust.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top