简体   繁体   中英

Windows8 Store app doesnt support onhashchange

I am trying to make an WIN8 app out of my html5 project. Unfortunately I have been using hashes and especially the event onhashchange which is not supported by Windows8 apps.

This event is not supported for Windows Store apps built for Windows using JavaScript. MSDN doc

I have been checking and apparently the event is emits a {} object when onhashchange

Is there any library or workaround to make the it pass the right event?

You will probably need to rewrite/adapt your code to use the WinJS.Navigation namespace. I guess that WinJS.Navigation.state could be used instead of the hash. Then call navigate with the same URL and a different state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM