Hi,

Try the following code:

document.observe('dom:loaded', function() {
        $('element-id').observe('click', function(event) {
                event.preventDefault();
                window.open(event.element().getAttribute('href'), 'myPopup',
'width=640,height=480');
        });
});

I've just tested it both in FF and IE. It works fine for me

On Apr 8, 12:39 pm, Rytis Daugirdas <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Here's a small example of code to open a new window when a link is
> clicked. The below code works fine in FF, but IE 7 opens the URL in
> the same window. How come?
>
> $('element-id').observe('click', function(event)
>                                  {
>
> window.open(event.element().getAttribute('href'), 'window-id');
>                                    Event.stop(event);
>                                  });
>
> Regards,
> Rytis
--~--~---------~--~----~------------~-------~--~----~
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