Potential problems setting [removed].hash

后端 未结 5 599
故里飘歌
故里飘歌 2020-12-15 05:02

I have some javascript code which, at one point, sets window.location.hash to a specific string. This works fine in Firefox 3, but I want to know if I will run

5条回答
  •  无人及你
    2020-12-15 05:54

    All "modern" (a.k.a A-Graded) browsers allow to set hash and do not reload the page when doing so. The ones that do reload the page are some of the older ones, such as Safari 2.0.4 and Opera 8.5x.

    See my Usenet post on comp.lang.javascript where I explain it in a bit more detail.

    Also note, that HTML5 finally specifies that hash setter should change actual hash but not reload the page.

提交回复
热议问题