Solved

onBlur/onFocus in IE and NS

Posted on 1998-08-06
2
537 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i count words? 2 44
Optimize simple Javascript code to use no repetitions 12 31
Button and js nou working 3 8
Create an automated page index 9 16
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…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

809 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