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

  • Thread starter Bill in Kansas City
  • Start date
B

Bill in Kansas City

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
 
E

Evertjan.

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".
 
T

Thomas 'PointedEars' Lahn

Bill said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top