I'm not really sure how you're code is set up, but the most generic
way would be use setInterval and clearInterval when the condition is
met
IE
function setObservers(){
if( $('myLinkId') ){
Event.observe('myLinkId', 'onclick', myFunctionName);
clearInterval(timer);
}
}
var timer = setInterval('setObservers',100);
It's not the most elegant solution, but w/o knowing exactly what
you're trying to do, it's the best i can offer.
On Feb 9, 7:22 pm, anathema <[EMAIL PROTECTED]> wrote:
> Newbie alert!
>
> So let's I have this in my javascript
>
> Event.observe('myLinkId', 'onclick', myFunctionName);
>
> or even
>
> $('myDivID').hide
>
> what if they don't exist yet? For example i am pulling in content via
> ajax.updater so some of my elements do not exist when the javascript
> is loaded. So all my javascript fails and the page does not function
> because it looks for those elements and does not find them.
>
> So do i handle this?
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---