Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Javascript Popup controlling parent window focus problem in FireFox

Posted on 2011-03-03
2
Medium Priority
?
1,296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
GreatGerm earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

598 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