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

x
?
Solved

Set focus to a recently opened window

Posted on 1998-10-05
4
Medium Priority
?
216 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
[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
  • 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 Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

618 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