On Apr 24, 9:31 pm, seran128 <[EMAIL PROTECTED]> wrote:
> Sample Code
>
> in my php
>
> <div id="mainDiv" style="display:none" >
>     <div id="innerDiv" style="display:none"  ></div>
>     <div id="outerDiv" style="display:none"  ></div>
> </div>
>
> in my function I display the mainDiv using.
>
> Element.show('mainDiv');
>
> Then I do a Ajax.Updater and the first time I try to load the content
> into the innerDiv. I get
> innerDiv is not defined in FireBug.
>

Do you try to load it when the page is loading? In that case you might
want to wrap your ajax-call in a dom loaded observer...

document.observe('dom:loaded', function(){
  //ajax call here
})

This ensures that all your DOM elements are actually loaded before you
try calling them.

Greetz,

Wizz


> I know what the reason for this is; that in my first call I show the
> parent Div "mainDiv" but the innerDIV has not registered with the DOM.
> My question is how do I show the parentDiv("mainDiv") and the child
> div at the same time so when I do my Ajax.Updater the
> childDiv("innerDiv") is registered with the DOM and I can place the
> XHTML into that div? After this works I flip the content out between
> the two div's. That way one div is displaying the content to the user
> and the other div is getting new content.
>
> I


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to