Im using the DomNodeInserted event listener (attached to the document) and on each fire of the event I retrieve the added node within the dom using:

    event.relatedNode

But when I try to use functions like:

    $(event.relatedNode).html($(event.relatedNode).html().replace(/a/g, "i"));

I've also tried the above without the prefixed $ before event.relatedNode but to no avail.

Yet I get this error in IE:
Error: Out of stack space
Source: Microsoft JScript runtime error

These are the elements returned via the events.relatedNode on each fire just FYI:

LOG: [object HTMLBodyElement]
LOG: [object HTMLSpanElement]
LOG: [object HTMLSpanElement]
LOG: [object HTMLSpanElement]
LOG: [object HTMLDivElement]

Any thoughts

$(event.relatedNode).html($(event.relatedNode).html().replace(/a/g, "i"));

is it working on other browsers;
d what browser versions have you been testing ?'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.