[jQuery] Re: $.post() speed

2009-10-12 Thread Adonis
Yeap, thanks fof the helping out!! I still may have some more questions and if so, i ll post some more! Kind regards, On Oct 9, 5:43 pm, MorningZ wrote: > You've got the "x" set inside the callback and are trying to alert it > *before* it gets back from it the $.postcall, hence it's empty > > so

[jQuery] Re: $.post() speed

2009-10-09 Thread MorningZ
You've got the "x" set inside the callback and are trying to alert it *before* it gets back from it the $.post call, hence it's empty so if you have $.post( ... do ajax stuff to variable "x" . ) alert(x); // <--- this gets run right away, the asynchronous call of $.post doesn't "wait to f

[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis
ok, here is an effort to sum up the code.. * function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) { var x; $("#division_name").bind("click", function() { if(this.value == "sth") { y=callFunction(a,b,c,d,e,f); $.ajax({ type: "POST",

[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis
ok, here is an effort to sum up the code.. * function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) { var x; $("#division_name").bind("click", function() { if(this.value == "sth") { y=callFunction(a,b,c,d,e,f); $.ajax({ type: "POST",

[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis
ok, here is an effort to sum up the code.. * function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) { var x; $("#division_name").bind("click", function() { if(this.value == "sth") { y=callFunction(a,b,c,d,e,f); $.ajax({ type: "POST",

[jQuery] Re: $.post() speed

2009-10-08 Thread MorningZ
You should should the specific $.post() code in detail, there's something you are missing because when you get back from the async call, everything (global variables, page objects) are fully available at that point... there's zero need to use setTimeout On Oct 8, 12:27 pm, Adonis wrote: > D

[jQuery] Re: $.post() speed

2009-10-08 Thread Adonis
Dan, I used a $.ajax() call with a callback -> success: function(msg) etc. but still it does not work the way I want to. from the server side i am using, * return render_to_response("blah.html",{ 'project_id':project_id }, context_instance = RequestContext(request)) * putting the project_id in a

[jQuery] Re: $.post() speed

2009-10-08 Thread Dan G. Switzer, II
Adonis, The $.post() function is asynchronous (by default) when your code hits a $.post() call, it'll keep executing code. In order to do something with the results of your AJAX call, you'll want to use the callback option--which is a function run when the AJAX call is completed. -Dan On Thu, Oct