Bruce wrote:

>
> ... but I don't understand why this format works and my original 
> attempt (below) didn't.  
The reason the second version works and the previous one doesn't is that 
the A in AJAX stands for Asynchronous.

That means that $.get(......) returns immediately, not after completing 
the load of content from the server; So that

any code immediately after the AJAX call in you function gets excuted 
immediately, not after the content has loaded.

That's the reason you pass callback functions to the AJAX calls ($.get, 
load, etc) - these get executed whenever

the server response arrives and is parsed. It's like calling setTimeout().

You can see this in action by adding an "alert" or Firbug "console.log" 
call after your $.get in the function.


- Dotan


Bruce MacKay wrote:

> Why is it that a solution appears immediately after sending a 
> help-me-please post.
>
> The function should have been
>
> function editThisNode(nodeID, nodeorder, pblID, bFullView, 
> bNodeDetail, sorder, origin, pagetypeID)
> {
> $.get("scripts/ajax_ramosus_editor.asp?id=8&nodeID=" + nodeID + 
> "&nodeorder=" + nodeorder + "&pblID=" + pblID + "&bFullView=" + 
> bFullView + "&bNodeDetail=" + bNodeDetail + "&origin=" + origin + 
> "&sorder=" + sorder + "&pagetypeID=" + pagetypeID, 
> function(responseText){$("div#editorbox").html(responseText);$('div#editor').tabs({fxFade:
>  
> true, fxSpeed: 'fast', fxAutoHeight: true})});
> }
>
> ... but I don't understand why this format works and my original 
> attempt (below) didn't. 
>
> Cheers,
>
> Bruce
>
>
>
> At 05:32 p.m. 30/11/2006, you wrote:
>> Hello folks,
>>
>> I've been using Klaus's tabs plugin to separate the main sections of 
>> an editor for an e-learning application - and until I tried to 
>> "improve things" today, it worked brilliantly.
>>
>> When the plugin worked, it was within a two section frame - one for a 
>> tree view of the lesson and the other for the editor.   To avoid the 
>> need for a frame, I merged the two frame contents into a single page 
>> and that's when my problem began.  I now find that the tabs no longer 
>> "work" properly - their respective contents are "stacked" on top of 
>> each other "down" the containing div
>>
>> I'd really appreciate some help if possible to recapture the tabs.   
>> If you visit the test site (below), click on any of the tree links 
>> (e.g. Meet Harry) to view my problem in the RHS div. The page can be 
>> viewed at:
>>
>> http://temporarius.massey.ac.nz/admin/ramosus_div.asp?id=treemap&pblID=8 
>> <http://temporarius.massey.ac.nz/admin/ramosus_div.asp?id=treemap&pblID=8> 
>>
>>
>> The tab contents are loaded via this function:
>>
>> function editThisNode(nodeID, nodeorder, pblID, bFullView, 
>> bNodeDetail, sorder, origin, pagetypeID)
>> {
>>          $.get("scripts/ajax_ramosus_editor.asp?id=8&nodeID=" + 
>> nodeID + "&nodeorder=" + nodeorder + "&pblID=" + pblID + 
>> "&bFullView=" + bFullView + "&bNodeDetail=" + bNodeDetail + 
>> "&origin=" + origin + "&sorder=" + sorder + "&pagetypeID=" + 
>> pagetypeID, 
>> function(responseText){$("div#editorbox").html(responseText);});
>>        
>>     $('div#editor').tabs({fxFade: true, fxSpeed: 'fast', 
>> fxAutoHeight: true});
>> }
>>
>> Thanks,
>>
>> Bruce
>>
>>
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
> ------------------------------------------------------------------------
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>   


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to