Hi,

> var al = function() {alert("Hello"); }
> var para = new Element('p', {class: 'button'}).update("Alert you?");
> para.observe('click', al);
>
> Doesn't this work in ie (after you add the paragraph to the DOM)?

As you say, you have to give the browser a moment to get it into the
DOM after adding it.  That was the subject of the link I gave him.
--
T.J. Crowder
tj / crowder software / com

On Oct 29, 3:08 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote:
> On 29.10.2008, at 16.26, Jonathan Rosenberg wrote:
>
>
>
> > I'm still quite new to Prototype, but I think you're missing some  
> > quotes in
> > your code below.  What you have now is
>
> >    var para = new Element('p',
> >            {'class':'button',onclick:'alert("hello");'}).update("Alert
> > You?");
>
> > Shouldn't it be
>
> >    var para = new Element('p',
>
> > {'class':'button',onclick:'\'alert("hello");\''}).update("Alert  
> > You?");
>
> var al = function() {alert("Hello"); }
> var para = new Element('p', {class: 'button'}).update("Alert you?");
> para.observe('click', al);
>
> Doesn't this work in ie (after you add the paragraph to the DOM)?
>
> //jarkko
>
> --
> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://odesign.fi
>
> Check out my latest book, Unobtrusive Prototype, fresh off the  
> Peepcode oven:http://peepcode.com/products/unobtrusive-prototype-js
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to