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

x
?
Solved

onBlur/onFocus in IE and NS

Posted on 1998-08-06
2
Medium Priority
?
555 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
[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 8

Accepted Solution

by:
jbirk earned 400 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

610 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