- if (window.location.hash != stateKey.value) {\r
- // console.log("updating stateKey with new browser hash: " +\r
- // window.location.hash);\r
- stateKey.value = window.location.hash;\r
- if (!stateKey.value)\r
- window.location.hash = '#1';\r
- stateKey.onchange();\r
+ // console.log("browser hash update response detected.");\r
+ // console.log("pz2watch:windowlocationhash: [" + stateKey.value + "]");\r
+ // console.log("window.location.hash: [" + window.location.hash + "]");\r
+ if (window.location.hash != stateKey.value) { \r
+ if (window.location.hash) {\r
+ //console.log("updating pz2watch:windowlocationhash with new window.location.hash [" + window.location.hash + "]");\r
+ stateKey.value = window.location.hash;\r
+ //console.log("firing pz2watch:windowlocationhash onChange");\r
+ stateKey.onchange();\r
+ } else if (stateKey.value) {\r
+ //console.log("updating window.location.hash with pz2watch:windowlocationhash [" + stateKey.value + "]");\r
+ window.location.hash = stateKey.value;\r
+ //console.log("firing pz2watch:windowlocationhash onChange");\r
+ stateKey.onchange();\r
+ } \r