Description:
User tried to load an html file located in the filesystem with an appended hash value (#value) but when trying to retrieve the value via window.location.hash this is null.
Test case:
Index.js
'use strict';
(function (e) {
var url = Ti.Filesystem.getResourcesDirectory() + 'html/index.html#myHash';
$.webView.url = url;
}());
$.index.open();
index.html
function updateHash() {
document.getElementById('content').textContent =
'url: ' + document.URL +
'\nhash: ' + window.location.hash;
}
Output:
[INFO] : url: file:///Users/mcota/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/2FA2A5DA-7AA4-4FFA-86F3-D634BD77BB39/WebViewHash.app/html/index.html
[INFO] : hash:
Additional Comments:
This only happens when the url is from the local filesystem, when the url is an http:// address returns the hash value correctly.
Work-around:
[~btran] - if a work-around was proposed to the customer, please post it to the JIRA.
The workaround we proposed involves setting the window.location.hash as part of a fireEvent. index.js