SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'Always on top' js alert?

    Hey guys,

    I've been tasked with improving a monitoring tool written by a former employee. He basically monitors many routers (via SNMP) and pops up a javascript alert when there is an error to report. Here's the problem - if the NOC guys don't have that particular browser window open (on top), they don't see the alert, as it only open on top of its parent window.

    I know how to bring a browser window in focus (onBlur = self.focus() but is there a way to reference an alert box through the DOM? I've looked around, but can't find any DOM references to alerts. This seems like a rather large oversight on the DOM model, so hopefully I'm just missing it.

    thanks guys...
    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Viral; no you're not missing anything; they're not scriptable. What you can do to emulate something like that is open a new (popup) window, write whatever was in your alert window into that, then keep that at the top.

    BTW, I don't know about the speed penalty associated with that, but I am guessing that it wouldn't be much considering that you're not opening a page from the server.

  3. #3
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Active X can do it!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #4
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    solved

    Shark - good idea. This was my original thought as well. But that would require a nearly complete rewrite of a VERY large (multi-language) script that monitors hundreds of routers. It simply wouldn't be worth the effort, IMO. Just an hour ago (after pondering this problem all night), I came up with a solution so stupidly simple, I'm embarrassed to even admit it

    You don't have to bring focus to the alert, you simply have to bring focus to the parent document just before it opens the alert! SIGH. So my problem was solved with a single line to the script after all that wasted brainpower =)

    Flawless - Active X? You must be new at this.
    I work for Vint Cerf in the Advanced Internet Technologies group of MCI/Worldcom. Our customers are almost entirely government and military. And our private IP network is one of the most secure in the world. On top of being purely unix (non-native active x architecture), active x presents huge security holes. Our security team would probably hang me by my toenails if I used that in our environment.

    Thanks, guys, for the responses. This board is awesome. I rarely fail to get a response from my posts. Now I suppose I should solve a few problems for ppl while I'm here (it's been a while )
    A computer without Windows is like a chocolate cake without mustard.

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not new to this.

    If you want to do what you proposed - you have to use an activeX control.
    You can spawn it through another classid to avoid security issues.

    This doesn't sound like a valid solution to you.

    If you ask to do something and i give you an answer,
    (which is- i think - the only way of doing what you suggested), please don't try to shoot me down or try to humiliate me - i'm giving you the only solution to the problem you posted.

    activeX isn't an ideal solution to what you wanted to do, but it's the only way to do it in standard html.

    Other methods of handling the system spawned alert would involve invoking an xwt window, and that would be plain labourious.

    If the fact that it's not actually an alert doesn't matter then definately go with Shark's solution.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •