[jQuery] Re: .load() and timing

2009-02-16 Thread jhm
>>The callback function (that in this case is the second parameter in >>the load function) gets called once snippet has actually returned. That was it. Should have known better, but I really appreciate the input. Thanks!

[jQuery] Re: .load() and timing

2009-02-15 Thread Karl Rudd
Ajax is "asynchronous", which is to say that you make the call to get the data, then it could take a few seconds for it to appear. During that time JavaScript code keeps going. So your code for "populate fields" most executes before the page snippet is actually loaded. What you need to do is: fu

[jQuery] Re: .load() and timing

2009-02-15 Thread jhm
> You'll probably need to supply a snippet of the relevant bit of your > code. It could be a number of things. Is this enough? function addActivity(activity, name, id) { // load activity snippet $(#activity).load('activity.html');

[jQuery] Re: .load() and timing

2009-02-15 Thread Karl Rudd
You'll probably need to supply a snippet of the relevant bit of your code. It could be a number of things. Make sure you're doing the modifications to the loaded HTML (which will be located in the element you've chosen) in the callback function. You might be better off using the $.get() function

[jQuery] Re: .load() and timing

2009-02-15 Thread Tze Yang Ng
any code fragment to look at ? not the whole chunk, just the part focusing on the part u are referring to. == On Mon, Feb 16, 2009 at 1:05 PM, jhm wrote: > > I'm new to jquery and so far it's awesome. I've run into a problem, > however, that I don't fully understand how to deal with. (sorry for