5
Contributors
11
Replies
13
Views
6 Years
Discussion Span
Last Post by stbuchok
0

Sorry, when the window receives focus and when it loses focus.

I am sorry !
I could not get meaning of 'focus' mainly in case of Javascript ....
Moreover what kind of focus is it talking about ??

I would be glad if you could elaborate.

Thanx

-1

OK, seriously!? Read all of them.

To converge on or toward a central point of focus; be focused.
To concentrate attention or energy.

If your not going to read an answer don't ask the question.

0

What are window.onblur/window.onfocus used for ????

Please help !
Thanx

The window: onblur and onfocus are events of a browser window which were used to determine if the app is in front or behind another app.

This way web jerks were able to detect when you switched to another window and bring it back in, on top of the current and continue to annoy you.

0

I am sorry !
I could not get meaning of 'focus' mainly in case of Javascript ....
Moreover what kind of focus is it talking about ??

I would be glad if you could elaborate.

Various elements in a browser page (including the page itself) take "focus" when they are clicked or visited with the tab key.

Two event types are associated with "focus":

  • onfocus: an event that fires when focus is gained
  • onblur: an event that fires when focus is lost

As with all events, javascript provides the means to attach custom functionality to elements by attaching event handlers (javascript functions) to them.

Much of the skill in writing interactive web pages lies in knowing how to write event handlers.

Airshow

0

Whatever you click your mouse on has focus. Clicking on something different causes the focus to blur.
onfocus was more populare when netscape 4 was around because it didn't recognise onclick.

0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <frameset cols="150,*">
      <frame name="toc"
             src="/ajax_tut.htm"
             onfocus='myFocusFunc()'
             marginwidth="1" marginheight="1" scrolling="AUTO">
      <frame name="body"
             src="/headInfo.htm"
             marginwidth="10" marginheight="5" scrolling="AUTO">
    </frameset>
    <head>
       <title>Focus !</title>
       <script type="text/javascript">
           function myFocusFunc() {
               alert('This means you are focusing here !');
           }
       </script>
    </head>
    <body>
        <p>
            &nbsp;</p>
    </body>
</html>

I have tried to use onfocus ....
so that when I click on the window the function gets invoked !
Still it is doing what is intended !!!!
Please help !

0

Why do you have a frameset outside the body tag and above the head tag? Also do the onfocus stuff inside the html page that is being loaded in the frame not on the frame or frameset. Frame and frameset support onload and I believe onunload but no other events.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.