Need suggestion on raising user's attention using javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CW

    Need suggestion on raising user's attention using javascript

    I wrote an HTML based chat application. The front end is built entirely on
    HTML + javascript. Essentially, I have a hidden frame that's refreshed
    frequently and any new messages are displayed in another frame using
    document.write. My problem is that since chat screen can be obscured by
    other applications/windows, I have no way of informing users that new
    messages have arrived other than popping the window to the top using
    window.focus. However, I think this method is rather crude because user
    might be typing away in another chat window and gets rudely interrupted by
    the window popping up and taking the focus away from the textbox they are
    typing into. The preferred method is to flash the icon on toolbar (obviously
    it only works on Microsoft windows just like other instant messaging
    applications). This would provide a visual cue to the user that a new
    message has arrived but won't interrupt user from working on whatever they
    were working on. I can't quite figure out how to do it using javascript, if
    it's actually even possible. If not, I would appreciate some suggestions of
    raising user's attention without being too abrupt.

    Thanks in advance


  • kaeli

    #2
    Re: Need suggestion on raising user's attention using javascript

    In article <416bb2a2$0$267 06$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
    CW@nospam.com enlightened us with...[color=blue]
    > I wrote an HTML based chat application. The front end is built entirely on
    > HTML + javascript. Essentially, I have a hidden frame that's refreshed
    > frequently and any new messages are displayed in another frame using
    > document.write. My problem is that since chat screen can be obscured by
    > other applications/windows, I have no way of informing users that new
    > messages have arrived other than popping the window to the top using
    > window.focus. However, I think this method is rather crude because user
    > might be typing away in another chat window and gets rudely interrupted by
    > the window popping up and taking the focus away from the textbox they are
    > typing into. The preferred method is to flash the icon on toolbar (obviously
    > it only works on Microsoft windows just like other instant messaging
    > applications). This would provide a visual cue to the user that a new
    > message has arrived but won't interrupt user from working on whatever they
    > were working on. I can't quite figure out how to do it using javascript, if
    > it's actually even possible. If not, I would appreciate some suggestions of
    > raising user's attention without being too abrupt.
    >[/color]

    You can't do this with javascript, as it doesn't have the proper access to
    the Windows API.
    If you have .net, you can use VB.NET to do it. C and Delphi can talk to the
    API, too. But it sounds like you're not into making a full-blown windows
    application, so this might not work for you.

    You could try an alert. It won't steal focus and the alert should flash the
    taskbar button (windows standard, I believe). I know it does on my system. Of
    course, then the user has to click okay on the alert, but it's better than
    stealing focus.

    --
    --
    ~kaeli~
    Never argue with an idiot! People may not be able to tell
    you apart.



    Comment

    • CW

      #3
      Re: Need suggestion on raising user's attention using javascript

      Thanks for your suggestion.

      Just wondering if there is a way to detect a particular window/frame
      actually has focus. I like your idea of using alert to notify user
      unobtrusively. However, I need a way to know whether the window already has
      the user attention by checking to see the window already has the focus. I
      looked through javascript reference and there doesn't seem to be a way to do
      it. Any idea?

      Thanks again

      "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
      news:MPG.1bd5b4 f4c3e1206498a1b c@nntp.lucent.c om...[color=blue]
      > In article <416bb2a2$0$267 06$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
      > CW@nospam.com enlightened us with...[color=green]
      >> I wrote an HTML based chat application. The front end is built entirely
      >> on
      >> HTML + javascript. Essentially, I have a hidden frame that's refreshed
      >> frequently and any new messages are displayed in another frame using
      >> document.write. My problem is that since chat screen can be obscured by
      >> other applications/windows, I have no way of informing users that new
      >> messages have arrived other than popping the window to the top using
      >> window.focus. However, I think this method is rather crude because user
      >> might be typing away in another chat window and gets rudely interrupted
      >> by
      >> the window popping up and taking the focus away from the textbox they are
      >> typing into. The preferred method is to flash the icon on toolbar
      >> (obviously
      >> it only works on Microsoft windows just like other instant messaging
      >> applications). This would provide a visual cue to the user that a new
      >> message has arrived but won't interrupt user from working on whatever
      >> they
      >> were working on. I can't quite figure out how to do it using javascript,
      >> if
      >> it's actually even possible. If not, I would appreciate some suggestions
      >> of
      >> raising user's attention without being too abrupt.
      >>[/color]
      >
      > You can't do this with javascript, as it doesn't have the proper access to
      > the Windows API.
      > If you have .net, you can use VB.NET to do it. C and Delphi can talk to
      > the
      > API, too. But it sounds like you're not into making a full-blown windows
      > application, so this might not work for you.
      >
      > You could try an alert. It won't steal focus and the alert should flash
      > the
      > taskbar button (windows standard, I believe). I know it does on my system.
      > Of
      > course, then the user has to click okay on the alert, but it's better than
      > stealing focus.
      >
      > --
      > --
      > ~kaeli~
      > Never argue with an idiot! People may not be able to tell
      > you apart.
      > http://www.ipwebdesign.net/wildAtHeart
      > http://www.ipwebdesign.net/kaelisSpace
      >[/color]


      Comment

      • kaeli

        #4
        Re: Need suggestion on raising user's attention using javascript

        In article <416c3d71$0$418 6$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
        CW@nospam.com enlightened us with...[color=blue]
        > Thanks for your suggestion.
        >
        > Just wondering if there is a way to detect a particular window/frame
        > actually has focus. I like your idea of using alert to notify user
        > unobtrusively. However, I need a way to know whether the window already has
        > the user attention by checking to see the window already has the focus. I
        > looked through javascript reference and there doesn't seem to be a way to do
        > it. Any idea?[/color]

        Sure.
        Write a focus/blur handler pair that sets and unsets a variable.

        A quick little study.
        Tested in IE6 and Firefox 1.0.
        The taskbar did indeed flash when there was no focus.

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
        "http://www.w3.org/TR/REC-html40/loose.dtd">
        <html>
        <head>
        <title> New Document </title>
        <script type="text/javascript">
        var hasFocus = true;

        window.onfocus = setFocus;
        window.onblur = unsetFocus;

        function setFocus()
        {
        hasFocus = true;
        }
        function unsetFocus()
        {
        hasFocus = false;
        }

        function checkFocus()
        {
        if (hasFocus)
        {
        alert("window has focus");
        }
        else
        {
        alert("no focus.");
        }
        }
        var t = window.setTimeo ut("checkFocus( )",5000);
        var t2 = window.setTimeo ut("checkFocus( )",7000);
        </script>
        </head>

        <body>
        <p>Let's see...</p>
        </body>
        </html>

        --
        --
        ~kaeli~
        He had a photographic memory that was never developed.



        Comment

        • CW

          #5
          Re: Need suggestion on raising user's attention using javascript

          Thanks again for your help.

          My problem is the javascript is run in the hidden frame (thus it would never
          gain focus by default) as user types away in another frame. When javascript
          detects new message, I need to check to see whether the frame that holds the
          input form (where user types in messages) actually has focus. I am not sure
          how to check variable value in another window.

          Essentially I have the following code in the entry frame (where user types
          input) in its head script block.
          ....
          var HasFocus=true;
          window.onblur=' HasFocus=false; '
          ....

          In the hidden frame, I tried something like
          ....
          if top.entry.windo w.HasFocus==fal se
          top.entry.windo w.focus()
          ....

          IE neither complained nor seemed to have run the script.

          Now an entirely different question here. Is it possible to open a pop-up
          window in its own browser instance. What I mean by this is that a pop-up
          window is opened using window.open, the pop-up and parent share the same
          browser instance. I noticed that if I could put chat windows in different
          browser instances, focus method would flash the icon on toolbar rather than
          popping up while typing away in another chat window. Thus if I could somehow
          open a new chat window in its own browser instance, I could use focus to
          achieve the effect I am after.

          Thanks a lot for your help so far and I really appreciate it.

          "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
          news:MPG.1bd605 0bdaa7990a98a1c 2@nntp.lucent.c om...[color=blue]
          > In article <416c3d71$0$418 6$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
          > CW@nospam.com enlightened us with...[color=green]
          >> Thanks for your suggestion.
          >>
          >> Just wondering if there is a way to detect a particular window/frame
          >> actually has focus. I like your idea of using alert to notify user
          >> unobtrusively. However, I need a way to know whether the window already
          >> has
          >> the user attention by checking to see the window already has the focus. I
          >> looked through javascript reference and there doesn't seem to be a way to
          >> do
          >> it. Any idea?[/color]
          >
          > Sure.
          > Write a focus/blur handler pair that sets and unsets a variable.
          >
          > A quick little study.
          > Tested in IE6 and Firefox 1.0.
          > The taskbar did indeed flash when there was no focus.
          >
          > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
          > "http://www.w3.org/TR/REC-html40/loose.dtd">
          > <html>
          > <head>
          > <title> New Document </title>
          > <script type="text/javascript">
          > var hasFocus = true;
          >
          > window.onfocus = setFocus;
          > window.onblur = unsetFocus;
          >
          > function setFocus()
          > {
          > hasFocus = true;
          > }
          > function unsetFocus()
          > {
          > hasFocus = false;
          > }
          >
          > function checkFocus()
          > {
          > if (hasFocus)
          > {
          > alert("window has focus");
          > }
          > else
          > {
          > alert("no focus.");
          > }
          > }
          > var t = window.setTimeo ut("checkFocus( )",5000);
          > var t2 = window.setTimeo ut("checkFocus( )",7000);
          > </script>
          > </head>
          >
          > <body>
          > <p>Let's see...</p>
          > </body>
          > </html>
          >
          > --
          > --
          > ~kaeli~
          > He had a photographic memory that was never developed.
          > http://www.ipwebdesign.net/wildAtHeart
          > http://www.ipwebdesign.net/kaelisSpace
          >[/color]


          Comment

          • kaeli

            #6
            Re: Need suggestion on raising user's attention using javascript

            In article <416c4d74$0$418 6$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
            CW@nospam.com enlightened us with...[color=blue]
            > Thanks again for your help.
            >
            > My problem is the javascript is run in the hidden frame (thus it would never
            > gain focus by default) as user types away in another frame. When javascript
            > detects new message, I need to check to see whether the frame that holds the
            > input form (where user types in messages) actually has focus. I am not sure
            > how to check variable value in another window.
            >[/color]

            I am, but during testing, it didn't work very well in IE. For whatever
            reason, the focus and blur events weren't firing when I expected them to (I
            had to click on things to fire them).
            Now, since you mention that the user is typing, I found a decent workaround
            by attaching the handlers to the textarea focus and blur instead of the
            window.
            But then for some other odd reason, IE doesn't flash the toolbar button,
            which was the entire point of the exercise.
            Note that Firefox did great for all tests and worked as expected for
            everything.

            If you want to play, I got this far.

            Frameset:
            <html>
            <frameset rows="*" frameborder="ye s" border="1" framespacing="0 " cols="100,*"
            bordercolor="#e eeeee" topmargin="0" leftmargin="0" marginheight="0 "
            marginwidth="0" >
            <frame name="leftFrame " scrolling="auto " src="test.html"
            bordercolor="#e eeeee" frameborder="no ">
            <frame name="mainFrame " src="test2.html "
            scrolling="auto " bordercolor="#e eeeee" frameborder="no ">
            </frameset>
            </frameset>
            </html>

            test.html: (this would be your hidden frame)
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
            <html>
            <head>
            <title> New Document </title>
            <script type="text/javascript">

            function checkFocus()
            {
            if (top.frames[1].getFocus())
            {
            top.alert("has focus");
            }
            else
            {
            top.alert("no focus.");
            }
            }
            var t = window.setTimeo ut("checkFocus( )",2000);
            var t = window.setTimeo ut("checkFocus( )",6000);
            </script>
            </head>

            <body>
            <p>Let's see...</p>
            <input type="button" value="clicky" name="b1" onClick="checkF ocus()">
            </body>
            </html>

            test2.html (main frame)
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
            <html>
            <head>
            <title>test </title>
            <script type="text/javascript">
            var hasFocus = true;

            function setFocus()
            {
            hasFocus = true;
            }
            function unsetFocus()
            {
            hasFocus = false;
            }
            function getFocus()
            {
            return hasFocus;
            }

            </script>
            </head>

            <body>
            <p>Start typing in the text area.</p>
            <textarea name="t1" onFocus="setFoc us()" onBlur="unsetFo cus()"></textarea>
            </body>
            </html>

            [color=blue]
            >
            > Now an entirely different question here. Is it possible to open a pop-up
            > window in its own browser instance. What I mean by this is that a pop-up
            > window is opened using window.open, the pop-up and parent share the same
            > browser instance. I noticed that if I could put chat windows in different
            > browser instances, focus method would flash the icon on toolbar rather than
            > popping up while typing away in another chat window. Thus if I could somehow
            > open a new chat window in its own browser instance, I could use focus to
            > achieve the effect I am after.[/color]

            Not in a cross-browser manner.
            If this is IE only, we might be able to find something, but it might be
            ActiveX and require special security permissions. It is not a normal thing to
            do. Plus, IE is a memory hog. It might not be nice to pull up a new instance
            on people.
            You can't do it with any normal javascript. It would basically be a shell
            command.

            What you're doing seems best achieved in a way other than just a browser and
            some javascript, at least to me. ;)
            If this isn't just an exercise in javascript, you may want to consider other
            approaches.

            --
            --
            ~kaeli~
            The best part of having kids is giving them back to their
            parents.



            Comment

            • CW

              #7
              Re: Need suggestion on raising user's attention using javascript

              Thanks a lot. Appreciate your help.
              "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
              news:MPG.1bd6f8 be1bf5105d98a1c 4@nntp.lucent.c om...[color=blue]
              > In article <416c4d74$0$418 6$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,
              > CW@nospam.com enlightened us with...[color=green]
              >> Thanks again for your help.
              >>
              >> My problem is the javascript is run in the hidden frame (thus it would
              >> never
              >> gain focus by default) as user types away in another frame. When
              >> javascript
              >> detects new message, I need to check to see whether the frame that holds
              >> the
              >> input form (where user types in messages) actually has focus. I am not
              >> sure
              >> how to check variable value in another window.
              >>[/color]
              >
              > I am, but during testing, it didn't work very well in IE. For whatever
              > reason, the focus and blur events weren't firing when I expected them to
              > (I
              > had to click on things to fire them).
              > Now, since you mention that the user is typing, I found a decent
              > workaround
              > by attaching the handlers to the textarea focus and blur instead of the
              > window.
              > But then for some other odd reason, IE doesn't flash the toolbar button,
              > which was the entire point of the exercise.
              > Note that Firefox did great for all tests and worked as expected for
              > everything.
              >
              > If you want to play, I got this far.
              >
              > Frameset:
              > <html>
              > <frameset rows="*" frameborder="ye s" border="1" framespacing="0 "
              > cols="100,*"
              > bordercolor="#e eeeee" topmargin="0" leftmargin="0" marginheight="0 "
              > marginwidth="0" >
              > <frame name="leftFrame " scrolling="auto " src="test.html"
              > bordercolor="#e eeeee" frameborder="no ">
              > <frame name="mainFrame " src="test2.html "
              > scrolling="auto " bordercolor="#e eeeee" frameborder="no ">
              > </frameset>
              > </frameset>
              > </html>
              >
              > test.html: (this would be your hidden frame)
              > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
              > "http://www.w3.org/TR/REC-html40/loose.dtd">
              > <html>
              > <head>
              > <title> New Document </title>
              > <script type="text/javascript">
              >
              > function checkFocus()
              > {
              > if (top.frames[1].getFocus())
              > {
              > top.alert("has focus");
              > }
              > else
              > {
              > top.alert("no focus.");
              > }
              > }
              > var t = window.setTimeo ut("checkFocus( )",2000);
              > var t = window.setTimeo ut("checkFocus( )",6000);
              > </script>
              > </head>
              >
              > <body>
              > <p>Let's see...</p>
              > <input type="button" value="clicky" name="b1" onClick="checkF ocus()">
              > </body>
              > </html>
              >
              > test2.html (main frame)
              > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
              > "http://www.w3.org/TR/REC-html40/loose.dtd">
              > <html>
              > <head>
              > <title>test </title>
              > <script type="text/javascript">
              > var hasFocus = true;
              >
              > function setFocus()
              > {
              > hasFocus = true;
              > }
              > function unsetFocus()
              > {
              > hasFocus = false;
              > }
              > function getFocus()
              > {
              > return hasFocus;
              > }
              >
              > </script>
              > </head>
              >
              > <body>
              > <p>Start typing in the text area.</p>
              > <textarea name="t1" onFocus="setFoc us()" onBlur="unsetFo cus()"></textarea>
              > </body>
              > </html>
              >
              >[color=green]
              >>
              >> Now an entirely different question here. Is it possible to open a pop-up
              >> window in its own browser instance. What I mean by this is that a pop-up
              >> window is opened using window.open, the pop-up and parent share the same
              >> browser instance. I noticed that if I could put chat windows in different
              >> browser instances, focus method would flash the icon on toolbar rather
              >> than
              >> popping up while typing away in another chat window. Thus if I could
              >> somehow
              >> open a new chat window in its own browser instance, I could use focus to
              >> achieve the effect I am after.[/color]
              >
              > Not in a cross-browser manner.
              > If this is IE only, we might be able to find something, but it might be
              > ActiveX and require special security permissions. It is not a normal thing
              > to
              > do. Plus, IE is a memory hog. It might not be nice to pull up a new
              > instance
              > on people.
              > You can't do it with any normal javascript. It would basically be a shell
              > command.
              >
              > What you're doing seems best achieved in a way other than just a browser
              > and
              > some javascript, at least to me. ;)
              > If this isn't just an exercise in javascript, you may want to consider
              > other
              > approaches.
              >
              > --
              > --
              > ~kaeli~
              > The best part of having kids is giving them back to their
              > parents.
              > http://www.ipwebdesign.net/wildAtHeart
              > http://www.ipwebdesign.net/kaelisSpace
              >[/color]


              Comment

              • Ian L

                #8
                Re: Need suggestion on raising user's attention using javascript

                I'm not sure if the alert() method (or function) would keep the window
                out of focus while attracting the user. However, using JavaScript to
                make the icon at the start bar blink is not possible.

                Comment

                • Dr John Stockton

                  #9
                  Re: Need suggestion on raising user's attention using javascript

                  JRS: In article <416db4fe$0$316 43$5a62ac22@per-qv1-newsreader-
                  01.iinet.net.au >, dated Thu, 14 Oct 2004 09:06:40, seen in
                  news:comp.lang. javascript, CW <CW@nospam.co m> posted :
                  [color=blue]
                  >Lines: 148[/color]
                  [color=blue]
                  >Thanks a lot. Appreciate your help.
                  >"kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
                  >news:MPG.1bd6f 8be1bf5105d98a1 c4@nntp.lucent. com...[/color]

                  If you want maximum further assistance, see the newsgroup FAQ, in
                  particular Section 2.3 paras 1 & 6.

                  --
                  © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                  <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                  <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                  <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                  Comment

                  • J. J. Cale

                    #10
                    Re: Need suggestion on raising user's attention using javascript

                    I use a simple .wav file (bell ring) to alert my clients and write to the
                    status of the chat window for those who aren't wired. I check the session
                    status on refreshing new messages and track the users behavior(?check ed
                    message or not) by raising and lowering a flag whenever the chat gets or
                    loses focus. Works for me.
                    Jimbo
                    "CW" <CW@nospam.co m> wrote in message
                    news:416db4fe$0 $31643$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...[color=blue]
                    > Thanks a lot. Appreciate your help.
                    > "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
                    > news:MPG.1bd6f8 be1bf5105d98a1c 4@nntp.lucent.c om...[color=green]
                    > > In article[/color][/color]
                    <416c4d74$0$418 6$5a62ac22@per-qv1-newsreader-01.iinet.net.au >,[color=blue][color=green]
                    > > CW@nospam.com enlightened us with...[color=darkred]
                    > >> Thanks again for your help.
                    > >>
                    > >> My problem is the javascript is run in the hidden frame (thus it would
                    > >> never
                    > >> gain focus by default) as user types away in another frame. When
                    > >> javascript
                    > >> detects new message, I need to check to see whether the frame that[/color][/color][/color]
                    holds[color=blue][color=green][color=darkred]
                    > >> the
                    > >> input form (where user types in messages) actually has focus. I am not
                    > >> sure
                    > >> how to check variable value in another window.
                    > >>[/color]
                    > >
                    > > I am, but during testing, it didn't work very well in IE. For whatever
                    > > reason, the focus and blur events weren't firing when I expected them to
                    > > (I
                    > > had to click on things to fire them).
                    > > Now, since you mention that the user is typing, I found a decent
                    > > workaround
                    > > by attaching the handlers to the textarea focus and blur instead of the
                    > > window.
                    > > But then for some other odd reason, IE doesn't flash the toolbar button,
                    > > which was the entire point of the exercise.
                    > > Note that Firefox did great for all tests and worked as expected for
                    > > everything.
                    > >
                    > > If you want to play, I got this far.
                    > >
                    > > Frameset:
                    > > <html>
                    > > <frameset rows="*" frameborder="ye s" border="1" framespacing="0 "
                    > > cols="100,*"
                    > > bordercolor="#e eeeee" topmargin="0" leftmargin="0" marginheight="0 "
                    > > marginwidth="0" >
                    > > <frame name="leftFrame " scrolling="auto " src="test.html"
                    > > bordercolor="#e eeeee" frameborder="no ">
                    > > <frame name="mainFrame " src="test2.html "
                    > > scrolling="auto " bordercolor="#e eeeee" frameborder="no ">
                    > > </frameset>
                    > > </frameset>
                    > > </html>
                    > >
                    > > test.html: (this would be your hidden frame)
                    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                    > > "http://www.w3.org/TR/REC-html40/loose.dtd">
                    > > <html>
                    > > <head>
                    > > <title> New Document </title>
                    > > <script type="text/javascript">
                    > >
                    > > function checkFocus()
                    > > {
                    > > if (top.frames[1].getFocus())
                    > > {
                    > > top.alert("has focus");
                    > > }
                    > > else
                    > > {
                    > > top.alert("no focus.");
                    > > }
                    > > }
                    > > var t = window.setTimeo ut("checkFocus( )",2000);
                    > > var t = window.setTimeo ut("checkFocus( )",6000);
                    > > </script>
                    > > </head>
                    > >
                    > > <body>
                    > > <p>Let's see...</p>
                    > > <input type="button" value="clicky" name="b1" onClick="checkF ocus()">
                    > > </body>
                    > > </html>
                    > >
                    > > test2.html (main frame)
                    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                    > > "http://www.w3.org/TR/REC-html40/loose.dtd">
                    > > <html>
                    > > <head>
                    > > <title>test </title>
                    > > <script type="text/javascript">
                    > > var hasFocus = true;
                    > >
                    > > function setFocus()
                    > > {
                    > > hasFocus = true;
                    > > }
                    > > function unsetFocus()
                    > > {
                    > > hasFocus = false;
                    > > }
                    > > function getFocus()
                    > > {
                    > > return hasFocus;
                    > > }
                    > >
                    > > </script>
                    > > </head>
                    > >
                    > > <body>
                    > > <p>Start typing in the text area.</p>
                    > > <textarea name="t1" onFocus="setFoc us()"[/color][/color]
                    onBlur="unsetFo cus()"></textarea>[color=blue][color=green]
                    > > </body>
                    > > </html>
                    > >
                    > >[color=darkred]
                    > >>
                    > >> Now an entirely different question here. Is it possible to open a[/color][/color][/color]
                    pop-up[color=blue][color=green][color=darkred]
                    > >> window in its own browser instance. What I mean by this is that a[/color][/color][/color]
                    pop-up[color=blue][color=green][color=darkred]
                    > >> window is opened using window.open, the pop-up and parent share the[/color][/color][/color]
                    same[color=blue][color=green][color=darkred]
                    > >> browser instance. I noticed that if I could put chat windows in[/color][/color][/color]
                    different[color=blue][color=green][color=darkred]
                    > >> browser instances, focus method would flash the icon on toolbar rather
                    > >> than
                    > >> popping up while typing away in another chat window. Thus if I could
                    > >> somehow
                    > >> open a new chat window in its own browser instance, I could use focus[/color][/color][/color]
                    to[color=blue][color=green][color=darkred]
                    > >> achieve the effect I am after.[/color]
                    > >
                    > > Not in a cross-browser manner.
                    > > If this is IE only, we might be able to find something, but it might be
                    > > ActiveX and require special security permissions. It is not a normal[/color][/color]
                    thing[color=blue][color=green]
                    > > to
                    > > do. Plus, IE is a memory hog. It might not be nice to pull up a new
                    > > instance
                    > > on people.
                    > > You can't do it with any normal javascript. It would basically be a[/color][/color]
                    shell[color=blue][color=green]
                    > > command.
                    > >
                    > > What you're doing seems best achieved in a way other than just a browser
                    > > and
                    > > some javascript, at least to me. ;)
                    > > If this isn't just an exercise in javascript, you may want to consider
                    > > other
                    > > approaches.
                    > >
                    > > --
                    > > --
                    > > ~kaeli~
                    > > The best part of having kids is giving them back to their
                    > > parents.
                    > > http://www.ipwebdesign.net/wildAtHeart
                    > > http://www.ipwebdesign.net/kaelisSpace
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    Working...