DOMAssistant 2.7.2 released – triggerEvent and replace added

Version 2.7.2 of DOMAssistant has just been released, and beside from some small improvements and minor tweaks, it has two new and very interesting methods.

New methods

The two new methods are:

triggerEvent(evt, target)

The triggerEvent method allows you to trigger an event on an element, like this:

$("news").triggerEvent("click");

$("home-link").triggerEvent("mouseover", elementRef);

Very handy! Also, as pointed out in the release blog post, the event doesn’t actually occur, but the event handler is called within the proper context.

replace(content, returnNew)

The replace method allows you to replace an existing element with a new one. The new element can be specified either through an element, string or number reference. For example:

$("container").replace("<div><em>Way</em> cooler content!</div>");

$("container").replace(elementRef, true);

If the second parameter in the method call is set to true, it returns the new element; otherwise, the replace element is returned.

Downloading DOMAssistant 2.7.2

So, what are you waiting for? If you want a JavaScript library with the methods you will actually ever find any use for, mixed together with the fastest performance, go download DOMAssistant 2.7.2 now!

Leave a Reply

Your email address will not be published. Required fields are marked *