Thiemo Mättig

Thiemo’s Weblog

»Catch click events before the DOM is loaded«. This solution relies on jQuery, but can be rewritten to work without. The idea is to add onclick="return this );" snippets to the HTML source where needed. This tiny function is guaranteed to be there, because it is part of the documents <head>. What it does is delaying these clicks until the load event happened. »Catching clicks with clickCatcher before your JavaScript files have loaded/events been applied« explains a very similar solution that works without messing with the HTML and performs better because it does not leave active onclick handlers in the DOM when they are not needed any more.

Kommentare zu diesem Beitrag können per E-Mail an den Autor gesandt werden.

[ < Zurück zur Übersicht ]

Impressum & Datenschutz