Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random problem reading status bar with both IE6 and IE7

    I have a JS that under certain event (on focus) reads the status bar from IE6 and IE7 and performs certain action.
    It works on most of the cases, but in the log of this application, I see like 30% of the cases, the status bar returns blank.

    In my tests, both IE6 and IE7 works perfectly fine, in my development computer. But in production, with people coming from all over the world with who knows what funny software installed in their machine, it some times fails.

    When it fails, it mostly fails for all the user's section, but I've seen some cases when for the same user, sometimes it works and sometimes it doesn't.

    I'm thinking that may be a plugin installed in the user's browser might be interfering but I'm not sure.

    Please, any idea is very welcome.

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi fischermx, Welcome to Coding Forums!

    IE7 has a user-option to allow or not allow scripts to update the status bar. You can't depend on having access to the status bar.

    Here is an alternative idea. Any code that writes to the status bar should call the following function instead.
    Code:
    var gStatus = '';
    function setStatus(s)
    {
      gStatus = s;
      window.status = s;
    }
    Now when you need to read the status bar read gStatus instead.

    Just a quick idea

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. That's almost what I'm doing.
    But I don't need to write the status bar, I don't do it.
    I just read it.

  • #4
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Then what are you trying to get from the status bar? Perhaps there's another way to get what you need.

  • #5
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My code goes like this:

    I get all iframe elements:
    elements = document.getElementsByTagName("iframe");

    Then I iterate on them checking:
    if(elements[i].src.indexOf('googlesyndication.com') > -1)

    Then I assign an event to the onfocus:
    elements[i].onfocus = myfunc;

    And "myfunc" is:

    function myfunc(e, o)
    {
    statusbar = window.status;
    var img3 = new Image();
    img3.src = "htpp://blahblah?adtext=statusbar"
    }

  • #6
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope. I'm out of ideas, sorry.

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    onfocus fires when an element has no focus. Once focused, onfocus no longer fires. You have to blur on the element and re-focus to trigger onfocus again. Maybe that's why your code works inconsistently.


  •  

    Posting Permissions

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