Hello,
I ran into a problem when creating some new elements. I'm sure the
problem is mine, but I can't figure out the mistake I made. Hopefully
someone here can point out my error.
Using Prototype 1.6.0.2, I created and inserted two new elements into
a page.
popup_wrapper = new Element('div', {
id: 'logout_warning_popup',
style: 'position:relative;'
confirmation_button = new Element('input', {
type: 'button',
value: 'Ok',
onclick: "window.alert('button
clicked');"
popup_wrapper.insert(confirmation_button);
$('content').insert(popup_wrapper);
Very simple. In both IE7 and Firefox (3.5.7), the box and button
appeared correctly on the page. When I clicked on the "Ok" input in
Firefox, I received the 'button clicked' alert box. But when I clicked
the box in IE7, I got no alert box at all. And no indication that a js
error had occurred.
My first thought was that there might be a HTML syntax error that was
causing the IE problem. So I copied the HTML created by the above code
and made it a static part of the page. Now the button worked properly
in both IE and FF.
So there's something wrong in my creation of the elements that is
preventing the onclick event from firing, and I'm not sure what that
is. Any advice?
Thanks,
Ian
--
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 [email protected].
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.