[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set focus to a recently opened window

Posted on 1998-10-05
4
Medium Priority
?
217 Views
Last Modified: 2013-12-25
How do I move the focus to a recently opened window in IE4? Say I have a parent window, and want to open a subwindow (not a modal dialog). It works fine the first time, but if the user moves back to the parent window, and then wants to open the subwindow again, it doesn't get focus, and the user doesn't notice that it has been loaded with new data.

I've tried to use the focus method without success, because every _second time_ I get an "Access denied" error message.

The code looks like this:

function openwin()
{
  var newwin = window.open("myurl.asp?param1=value1",
               "mywin");
  newwin.focus();
}

Any thoughts?
0
Comment
Question by:mnprsd
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 400 total points
ID: 1855475
The newwin.focus() is correct.

The reason it does not work needs to be investigated - sounds like a bug!
In the mean time put a
<BODY onLoad="if (window.focus) self.focus()">
in the page returned from the asp


0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1855476
PS: What version does it say in HELP,ABOUT ?
IE4.0 is pretty buggy! 4.01 is a lot better

Michel
0
 

Author Comment

by:mnprsd
ID: 1855477
Thanks a lot, it works perfect.

And about the version; IE tells me I have version 4.0 (4.72.3110.8, SP1), but as far as I can remember, I recently installed version 4.01. But maybe 4.0 SP1 is the same thing.

However, thanks a lot again!
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1855478
Yep, that sounds like 4.01 (4.0 would be more like 4.70.2106.8) MS are so helpful in their version numbering and you can update the scripting engine separately.

Just to try and nail the bug, how exactly did you call your openwin function?
HREF, Button?

I hope to get enough info in order to add it to the BugList.

Thanks in advance

Michel
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

831 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