Solved

Javascript Popup controlling parent window focus problem in FireFox

Posted on 2011-03-03
2
1,258 Views
Last Modified: 2012-05-11
Hi guys,

I have the following development page with a link to "Launch Calculator".

As I cannot change the search results page, I'm building a Javascript popup window with a calculator to control the search results.

I need the calculator to be in focus at all times.  It is designed so that when you change a value in the Calculator - the search results are refreshed.  

The development link is http://centenary.thermosis.com/v2/calculator.flash.html

It is working perfectly in Internet Explorer, but not in Firefox.  Firefox initially loads the first search result pefectly, and the Calculator stays in focus. But the 2nd change to the Calculator opens a new browser window to show the results, and the new window takes focus.  If I then give focus to the calculator manually - it works from there on.

How can I make it work the same as Internet Explorer and Safari?

The various code snippets are shown below.

First page's javascript link:
<a href="#calculator" onClick="javascript: window.name = 'main'; window.open('calculator.html','mycalc','width=300,height=410'); return false;">Launch Calculator</a>

Open in new window


Popup's body code:
<body onblur="window.focus();">

Open in new window


Flash ActionScript 2 code to refresh the main window:
 
getURL(theURL, "main");

Open in new window

0
Comment
Question by:webstudiointeractive
2 Comments
 
LVL 17

Accepted Solution

by:
GreatGerm earned 500 total points
ID: 35038939
It looks like the pop-up isn't able to connect to the named window for some reason.  Try changing your call to something like getURL("javascript:window.opener.location = '" + theURL + "'; void(0);");
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now