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
Solved

onBlur/onFocus in IE and NS

Posted on 1998-08-06
2
540 Views
Last Modified: 2012-06-27
OK I have been doing my best to hack together a solution for this but, each one I come up with never quite works the way I want it to. So maybe you can help?

What I need is a JavaScript that will allow me to bring a second window spawned by the first to the Focus <front> state.

Example page one has a list of hyperlinks to images. When the user clicks a link in window one a new browser window is spawned and the image is displayed in that window.

No problem right? Well of coarse the first time you clisk the "popup" window displaying the image is in the front but then when you click on anouther link in window one, window two goes to the onBlur state.
Now of coarse if you click a link in window one it appears in window two as it should but window two is hidden behind window one in a blured state.

So creating window two is not a problem just getting it to come too the front when I click anouther link is?

some params:
1/I only want two windows
2/must work in IE and NS
3/ Like it to work in IE3 and NS3
which of coarse means that onFoucus/onBlur are out.

Now as far making the IE side of this work it does not have to be JavaScript. If you know some "pc talk" that will make it do the same thing by all means please share.

I look forward to your replies,

thanxs david
0
Comment
Question by:fusion123
2 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 100 total points
ID: 1267830
Hi David,
  I had a similar problem before, and spent a long time trying to get something to work in both browsers.  The only problem is that the command necesary to do this is winodw.focus(), which is JavaScript 1.1, which means it won't work in IE 3, but will work in the rest of the browsers.

This is the javascript function that I use: (it's for a help file, thus called help)
var help;
function load_help(position)
  {help=window.open("data_help.shtml" + position,"help","toolbar=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=350");
   help.focus();
  }

And then when calling this function, you do it like this:
<a href="javascript:load_help('#user_id')">
(I use #user_id because it is actually going to a link within the target page named user_id).

This should work fine in Netscape 3,4 and IE 4.

-Josh
0
 

Author Comment

by:fusion123
ID: 1267831
Thanxs exactly what I was look'n for.

cheers david
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article discusses how to create an extensible mechanism for linked drop downs.
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 viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

856 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