Solved

onBlur/onFocus in IE and NS

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

730 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