• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with onBlur() in BODY tag

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that this is illegal to use in HTML 4.01, but I want to keep a newly opened window on top. So, here's what I'm trying to do:
I have a webpage that open's a new window with no controls. In the new window I have placed, in the Body tag, onBlur="self.focus();" which ensures that the window always stays on top.
My goal is to make sure that the person viewing this window closes it and focus goes back to my original window.
Does anyone have any other ideas on how to do this? Using HTML 4.01.
BTW, where the hell is Eric???
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure that the body doesn't have an onBlur or onFocus method because the body is always called from the window object. Therefore, try this:
<BODY o-n-l-o-a-d="javascript: if(!window.focus()){window.focus()}"<
Might work.
Take out the "-"'s
Stupid Forum Control.
 
Sam Moran
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael thank you very much for the response! This doesn't work, unfortunatly
You are correct that the Body tag does not support the onBlur event, but it works?!?!?
I have searched the web and this is the method suggested, onBlur in the Body tag, in a lot of places. Even in Netscape!
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look at this:
http://www10.brinkster.com/A1ien51/Scripts/NoMin.htm
 
Sam Moran
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Eric, thank you very much! My co-worker and I were talking about that implementation yesterday, but were concerned about the window flickering. I tried your function and it is very acceptable. Thanks again!
BTW, how did your exams go?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
College Grad from PSU with a BS in Mechanical Engineering and no 'REAL' job as of yet....lol
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic