Link_to popup problems

so, I have a strange problem with popups using link_to and i’m not sure
what to look for.

My problem:
When I click the link it pops open a new window. When using internet
explorer 6 or 7 sometimes it will open the popup window AND open in
the same window. I tested it in Opera, FireFox, Safari and they all work
just fine, only internet exploder it will do this. The main issue is
that it doesn’t always do it, it’s intermittent.

My code:

<%= link_to(‘Seating Chart’, { :controller => ‘pages’, :action =>
‘seating_chart’, :id => @show }, :popup => true) %>

Any ideas?

Jeremy W. wrote:

so, I have a strange problem with popups using link_to and i’m not sure
what to look for.

My problem:
When I click the link it pops open a new window. When using internet
explorer 6 or 7 sometimes it will open the popup window AND open in
the same window. I tested it in Opera, FireFox, Safari and they all work
just fine, only internet exploder it will do this. The main issue is
that it doesn’t always do it, it’s intermittent.

My code:

<%= link_to(‘Seating Chart’, { :controller => ‘pages’, :action =>
‘seating_chart’, :id => @show }, :popup => true) %>

Any ideas?

Hi there,
Did you resolve this issue? I am having similar issue.

Thanks

Hi,

<%= link_to(‘Seating Chart’, { :controller => ‘pages’, :action =>
‘seating_chart’, :id => @show }, :popup => true) %>

Any ideas?
Well, in fact I dont have a real solution to your specific problem,
but some hints:
If you look at the generated html/js-code you should see a “return
false” as last call. This prevents the browser from following the href-
Link. But if there is any problem within the javascript-Code, the
return false is not executed anymore and thus, the browser jumps to
the href, even if the opening of the popup opens. But how can there be
an error within the javascript when it is fully generated by rails,
one might ask.

The solution might be found within project-specific javascript-code.
In my case I had a jquery-function which appended to all links and
which had an error. So every link produces an js-Error. Unfortunately,
these errors are hard to track - even with firebug- since the page is
newly loaded all js-Errors are reseted. One way which sometimes helps
is to modify the onclick-call via firebug, so that before the return-
call an alert(“hi!”) is called. So if you see no alert that is a
strong indicator that there is anything wrong with your js.

Another hint: just disable you js-library temporarily so that you can
see if the error occures nevertheless.

Hope this helped you a bit.

Greetings,
Yoche2001

Hi,

just a hint: try to disable temporarily your used js-library. I once
had an error in an jquery-event (added the click-Event) twice so that
each link with a onclick-Handler produced an js-Error and the “return
false” was never reached. Unfortunately these errors are hard to
track, even with firebug, since the main-page is newly loaded and so
the js-error-log is cleared.

Greetings,
Yoche2001