Results 1 to 4 of 4

Thread: Help with "self.focus"

  1. #1
    Join Date
    Sep 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with "self.focus"

    Is there anyway to modify the code below with an OnChange="self.focus" tag?

    Code:
    <head>
    <title>BYRD CHAT</title>
    </head>
    
    <body bgcolor="#000000" topmargin="0" leftmargin="0">
    
    <!-- Start of Freechatcode Script -->
    <form name="freechatform">
    <input type="hidden" name="lg" value="">
    <input type="hidden" name="cnm" value="thebyrdfamily">
    <input type="hidden" name="wm" value="Welcome%20to%20Byrd%20Chat">
    <input type="hidden" name="bg" value="000000">
    <input type="hidden" name="fg" value="ffffff">
    <input type="hidden" name="bw" value="">
    <input type="hidden" name="sh" value="0">
    </form>
    <script language="JavaScript" 
    src="http://www.freechatcode.com:8080/freechatcode/js/freecodenew.js"></script>
    <!-- End of Freechatcode Script -->
    All of this code will open in an independant window (SEE HERE), and anytime a new message comes up from the chat, I want the window to move to the front. I have tried changing the body tag to <BODY OnBlur="self.focus"> but it prevents you from using another window AND it renders the chat window unusable.

  2. #2
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I doubt that's easy to do, and it would be highly annoying if the chat is very active but the chatter is doing somehting else for a moment.

    You'd have to go through what the chat-script generates on the page. (In this case an I-Frame.) I don't know what the contents of that frame are but maybe you could do a simple check say every 5th second to see if the source of that frame is the same as it was 5 seconds ago. Since the page probably keeps reloading to update the chat, it's not easy to attach any event handlers and keep them there. They'd all be destroyed each time it i reloaded.

  3. #3
    Join Date
    Sep 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I figured it would have to be on the code associated with the chat itself . Never hurts to ask though.

  4. #4
    Join Date
    Sep 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is there a way to have a popup window self.focus when there is a sound? The new chat room I have added to my site will make a sound when a user leaves a message.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •