📜 ⬆️ ⬇️

Navigation in Ajax application

Everyone has long known a convenient way to organize navigation in Ajax-applications. This method is quite common and is based on changing the anchor (part of the page address after the sharp #).

This method works in many browsers. But as it turned out, not everywhere equally effective. Using this method in the explorer, I came across an unexpected effect. Below are the results of a small benchmark, which I wrote specifically for this case. I know, my friends, you love all sorts of benchmarks. Here is its code, it is very easy to understand:

var start = new Date().getTime();
window.location.hash = url
var stop = new Date().getTime();
alert( stop - start );


Here are the results:
Opera 10: 15 ms.
FF2: 30 ms.
FF3: 30 ms.
IE6: 323 ms.
IE7: 7825 ms.
IE8: 7240 ms.
')
Yes, of course, the structure of the document is very complex, it weighs as much as 240kb only in html. And against this background, it is very noticeable that the new version of IE began to work much faster, overtaking by 8% its younger brother! Hurray comrades! Viva Explorer! Long live Microsoft!

UPD: Thank you all, it's all in the included Developer Toolbar. Well, then yes, something to go through the anchor in the developer mode, you need to do it. The same number of changes in the system needs to be done when the developer moves along the anchor, as soon as a maximum of 0 such changes occur.

Source: https://habr.com/ru/post/57933/


All Articles