[jQuery] Re: trigger $(document).ready manually

2007-05-30 Thread MathiasBank
Well, I have an ajax call to the server. The sever decides what to do. Normally, there is just one small part of the page, which will be changed per json. But there is one possibility, which needs to refresh nearly the complete page. No I have to recall ready. There are three possibilites: 1. I

[jQuery] Re: trigger $(document).ready manually

2007-05-30 Thread MathiasBank
Ok, it's quite easy to recall ready: Don't register your ready functions like this: $(document).ready(...); Register it like this: $(document).bind(ready,...); Now, trigger the ready event: $(document).trigger(ready); This works. I think, it's a bit confusing, because $(document).ready is

[jQuery] Re: trigger $(document).ready manually

2007-05-30 Thread Dan G. Switzer, II
Mathias, Don't register your ready functions like this: $(document).ready(...); Register it like this: $(document).bind(ready,...); Now, trigger the ready event: $(document).trigger(ready); This works. I think, it's a bit confusing, because $(document).ready is an event (at least in the

[jQuery] Re: trigger $(document).ready manually

2007-05-29 Thread Brandon Aaron
ready() is just a special method that handles the DOM Ready event. I can't think of a use-case where one would need to force the call to ready but you can do so by calling jQuery.ready(). Once the function runs, it won't run again. I'm not sure what, if any, the consequences of doing this are.

[jQuery] Re: trigger $(document).ready manually

2007-05-29 Thread Sean Catchpole
Mathias, The solution is simplier than it seems. function foo(){...} $(document).ready(foo); //someplace where you want to call the document.ready again foo(); By wrapping the code that you want to call from document.ready inside a function it is easy to call again at any time. Of course

[jQuery] Re: trigger $(document).ready manually

2007-05-29 Thread Ⓙⓐⓚⓔ
don't use an anonymous function with ready. use a named one, and then just call it again (and again). On 5/29/07, Brandon Aaron [EMAIL PROTECTED] wrote: ready() is just a special method that handles the DOM Ready event. I can't think of a use-case where one would need to force the call to