why does browser behavior differ when using two different window.location.href assignments?

johntrepreneur

Why is the behavior different between Chrome and IE11 when making two window.location.href assignments in a row?

Chrome ignores the first assignment and will only issue a request for the last one.
IE11 will send a request for the both.

Repro'd here.
NOTE: You'll need to use a tool that can track the outbound requests like fiddler or similar to see the request go out on IE11.

Brad

It's up to the browser how to implement things like setting the location. One browser probably begins tearing down immediately, and the other probably continues running JavaScript until it's time for the next page to load. In Chrome, it is probably making both requests but the first is cancelled so quickly that it never actually makes it out of the browser.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why does setting window.location.href not stop script execution

From Dev

Cannot change to different windows using window.location.href

From Dev

Why isnt window.location.href= not forwarding to page using Safari?

From Dev

Why does the result of modulus operator with continued fractions differ when I use variables and differ for different compilers?

From Dev

Why does the result of modulus operator with continued fractions differ when I use variables and differ for different compilers?

From Dev

Why href="javascript:window.location.href='#xxx';" does't work?

From Dev

Using a variable for if window.location.href.indexOf()

From Dev

Passing parameters using Window.location.href

From Dev

Why does indexing numpy arrays with brackets and commas differ in behavior?

From Dev

Browser different rendering behavior with different location of script and link tag

From Dev

Why is event.state on window.onpopstate empty when pushing with same location.href (or empty)

From Dev

Waiting time is high when using window.location.href OR .assign or .reload

From Dev

Why does pycrypto return the same encryption result when using two different public keys?

From Dev

Why package installation order differ was different on two machines?

From Dev

Javascript if (window.location.href) adding two urls

From Dev

change href behavior when using boostrap

From Dev

Why server responses different HTTP redirect "Location" value using libcurl and browser?

From Dev

What does loc = $('<a>', {href:window.location})[0]; mean?

From Dev

Why does Log4J2 output differ on two systems when I am writing the same UTF-8?

From Dev

Eval does not work when using location.href property of Div tag

From Dev

Why does Arduino have two different behavior for character pointer processing for Mega 2560 and ESP8266?

From Dev

Why these assignments produce different results?

From Dev

Why Font looks differ browser to browser

From Dev

Why does performance differ when the only difference is in code paths that are not executed?

From Dev

How to test window.location.href using jasmine

From Dev

Redirect a Website to a local folder Using window.location.href() not working

From Dev

No output to iframe after using window.location.href

From Dev

No output to iframe after using window.location.href

From Dev

why do two seemingly identical hashmaps have different behavior when serialized by gson?

Related Related

  1. 1

    Why does setting window.location.href not stop script execution

  2. 2

    Cannot change to different windows using window.location.href

  3. 3

    Why isnt window.location.href= not forwarding to page using Safari?

  4. 4

    Why does the result of modulus operator with continued fractions differ when I use variables and differ for different compilers?

  5. 5

    Why does the result of modulus operator with continued fractions differ when I use variables and differ for different compilers?

  6. 6

    Why href="javascript:window.location.href='#xxx';" does't work?

  7. 7

    Using a variable for if window.location.href.indexOf()

  8. 8

    Passing parameters using Window.location.href

  9. 9

    Why does indexing numpy arrays with brackets and commas differ in behavior?

  10. 10

    Browser different rendering behavior with different location of script and link tag

  11. 11

    Why is event.state on window.onpopstate empty when pushing with same location.href (or empty)

  12. 12

    Waiting time is high when using window.location.href OR .assign or .reload

  13. 13

    Why does pycrypto return the same encryption result when using two different public keys?

  14. 14

    Why package installation order differ was different on two machines?

  15. 15

    Javascript if (window.location.href) adding two urls

  16. 16

    change href behavior when using boostrap

  17. 17

    Why server responses different HTTP redirect "Location" value using libcurl and browser?

  18. 18

    What does loc = $('<a>', {href:window.location})[0]; mean?

  19. 19

    Why does Log4J2 output differ on two systems when I am writing the same UTF-8?

  20. 20

    Eval does not work when using location.href property of Div tag

  21. 21

    Why does Arduino have two different behavior for character pointer processing for Mega 2560 and ESP8266?

  22. 22

    Why these assignments produce different results?

  23. 23

    Why Font looks differ browser to browser

  24. 24

    Why does performance differ when the only difference is in code paths that are not executed?

  25. 25

    How to test window.location.href using jasmine

  26. 26

    Redirect a Website to a local folder Using window.location.href() not working

  27. 27

    No output to iframe after using window.location.href

  28. 28

    No output to iframe after using window.location.href

  29. 29

    why do two seemingly identical hashmaps have different behavior when serialized by gson?

HotTag

Archive