DOMReady, onclick functions?
Hello, I was wondering if there are any DomReady event functions and onclick functions. I was doing some reading and found that onclick sometimes does not work in different browsers and can cause bubbling. I would go to a framework (preferably Mootools), but Im trying to avoid it.
I would rather have some function that runs the function when the dom is ready. As Im sure all of us are sick of putting window.onload = function() etc... The onclick I can see being harder to find, but the DOM Ready Event has to exist out there without using a framework, right?
Let me know, thanks!
just put your tag at the end of the body instead of the head.
when the code in the script fires, your document is ready.
you can even just place a function call down there, activating script you defined in the head or wherever:
tiny, simple, and 120% cross browser compatible.
for a convoluted example that can run from the head: http://www.agileapproach.com/blog-en...ready-function
Last edited by rnd me; 04-06-2011 at 11:55 PM.
myReady is a function you define, perhaps in code that's loaded from the <head> tag. In place of a normal .ready() call, you name a function, any function, myReady. when the document is ready, myReady() will be fired.
Originally Posted by mikewgd
alert("tags are ready, but images might still be loading");
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)