document.location = 'some href', why a delay in IE?

Discussion in 'Javascript' started by Bill in Kansas City, May 12, 2009.

  1. IE7, Windows XP SP3 (and presumably, IE6)

    I'm working with a menu system that structures menu items like so:

    <div id="container">
    <div onclick="document.location = 'some href'" id="item">
    <a href="some href">
    Link Text Here
    </a>
    </div>
    </div>

    The div onclick event has a five to eight second delay before the
    browser reacts. If I remove the onclick event of the item div, the
    browser reacts instantaneously. Firefox does not exhibit this
    behavior.

    I've tried event.cancelBubble on the div onClick to see if that was
    the cause, but there was no change, I still get the delay.

    I can't afford the time to write a new menu system, and as always the
    boss is breathing down my neck to find a solution. (And he won't
    accept, "It's just a quirk with IE" as an answer.) Any ideas how to
    eliminate the delay?

    Thanks in advance!

    - Bill in Kansas City
     
    Bill in Kansas City, May 12, 2009
    #1
    1. Advertising

  2. Bill in Kansas City

    Evertjan. Guest

    Bill in Kansas City wrote on 12 mei 2009 in comp.lang.javascript:

    > IE7, Windows XP SP3 (and presumably, IE6)
    >
    > I'm working with a menu system that structures menu items like so:
    >
    > <div id="container">
    > <div onclick="document.location = 'some href'" id="item">
    > <a href="some href">
    > Link Text Here
    > </a>
    > </div>
    > </div>
    >
    > The div onclick event has a five to eight second delay before the
    > browser reacts. If I remove the onclick event of the item div, the
    > browser reacts instantaneously. Firefox does not exhibit this
    > behavior.
    >
    > I've tried event.cancelBubble on the div onClick to see if that was
    > the cause, but there was no change, I still get the delay.
    >
    > I can't afford the time to write a new menu system, and as always the
    > boss is breathing down my neck to find a solution. (And he won't
    > accept, "It's just a quirk with IE" as an answer.) Any ideas how to
    > eliminate the delay?


    Educate your boss.

    This educating is one of the most important tasks in programming.
    You are the doctor, he is the patient.
    He pays, but you should let him be aware of your expertise,
    and give him advice that he can only ignore to his peril.
    [or she]

    And next time, do not programme such strange scripts.
    Use timeouts, or better use bubble breakers like "return false".

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., May 12, 2009
    #2
    1. Advertising

  3. Bill in Kansas City wrote:
    > IE7, Windows XP SP3 (and presumably, IE6)
    >
    > I'm working with a menu system that structures menu items like so:
    >
    > <div id="container">
    > <div onclick="document.location = 'some href'" id="item">
    > <a href="some href">
    > Link Text Here
    > </a>
    > </div>
    > </div>


    That's nonsense. Modify as follows:

    <div id="container">
    <div id="item">
    <a href="foo"
    onclick="window.location = 'bar'; return false"
    >Link Text Here</a>

    </div>
    </div>

    Beats me why you think you need it, anyhow your IE problem will go away with
    this.


    PointedEars
     
    Thomas 'PointedEars' Lahn, May 12, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,032
    Smokey Grindel
    Dec 2, 2006
  2. saiho.yuen
    Replies:
    3
    Views:
    446
    kaeli
    Sep 14, 2004
  3. Phil Powell
    Replies:
    8
    Views:
    459
    Phil Powell
    Oct 27, 2004
  4. Replies:
    2
    Views:
    491
  5. Alex Bird
    Replies:
    3
    Views:
    190
    Thomas 'PointedEars' Lahn
    May 9, 2008
Loading...

Share This Page