Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > document.location = 'some href', why a delay in IE?

Reply
Thread Tools

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

 
 
Bill in Kansas City
Guest
Posts: n/a
 
      05-12-2009
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
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      05-12-2009
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)
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-12-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hmmm, why is there a delay when saving files in Fx? Wedge Firefox 6 10-24-2008 10:10 PM
Why does producer delay halt shell pipe? dwhall Python 2 12-12-2007 01:31 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Calculating propagation delay & transmission delay Stone Cisco 1 09-27-2006 06:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57