如果您有一个带有哈希的 URL,例如:
www.my_jqm_site.com/#some_page_request
...在 jqm 页面事件序列期间的什么时候 jqm 读取哈希?
Event sequence when navigating from jqm_page_A to jqm_page_B ... thanks Muhammed Basil.
- document --- script time (js is readable, but DOM is not ready yet)
- document --- ready
- page B --- pagebeforecreate
- page B --- pagecreate
- page B --- pageinit
- page A --- pagebeforehide
- page B --- pagebeforeshow
- page A --- pageremove
- page A --- pagehide
- page B --- pageshow
- body --- onLoad
编辑:如果我在脚本时更改哈希:
<script>
window.location.hash = "#some_other_page_request"
</script>
它将覆盖传入的哈希“#some_page_request”,因此 jqm 将导航到反而。
这表明 jqm 在脚本时或之后读取哈希(即在 $(document).ready(...) 时或之后)。