[jQuery] Re: Catch a click event before the DOM is loaded

2007-10-02 Thread polyrhythmic
Remy, I like your very simple solution, queuing events to be processed once the DOM is ready. Two questions, though: 1. Why not use if ($.isReady === true) ? Were you getting a value for $.isReady besides 'undefined'? 2. Will you run into any problems if a user clicks a button multiple

[jQuery] Re: Catch a click event before the DOM is loaded

2007-10-01 Thread Sam Collett
Wouldn't it be easier just to hide the button via CSS and then show it when the document is ready? Or disable the button (via html) then enable it again via script? On Oct 1, 12:38 pm, Remy Sharp [EMAIL PROTECTED] wrote: I've recently been working on a project where the page is complex enough

[jQuery] Re: Catch a click event before the DOM is loaded

2007-10-01 Thread Remy Sharp
It really depends on the solution you're working on. In this particular case, it would odd if the button had just appeared, and on some pages there's a button for each row on a large table of data. Disabling it first then enabling is a better approach, but the solution I went for, still

[jQuery] Re: Catch a click event before the DOM is loaded

2007-10-01 Thread Guy Fraser
Remy Sharp wrote: I've recently been working on a project where the page is complex enough that the DOM would not have loaded before the user had spotted our 'big red button' - and clicked away. Couldn't you just use this: http://jquery.com/plugins/project/elementReady

[jQuery] Re: Catch a click event before the DOM is loaded

2007-10-01 Thread Remy Sharp
On Oct 1, 9:06 pm, Guy Fraser [EMAIL PROTECTED] wrote: Couldn't you just use this: http://jquery.com/plugins/project/elementReady Not when there are more than a few buttons on the page. This plugin works fine if your button has a particular Id attached to it, some of the pages we were