Solved

onBlur/onFocus in IE and NS

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now