I currently have this code to call a function from a hash value on page load:
$(function() {
var hash = window.location.hash.substring(1);
window[hash]();
});
This works great.
However, my Javascript in namespaced like so:
var help = {
faq: function () {
//do stuff
},
newFeatures: function () {
//do stuff
}
}
My function that I listed up top does not work for namespaced javascript. I've tried manually adding the namespace to the front (so var hash = "help." + window.location.hash.substring(1);
) but that did not work.
How can I navigate around this issue without removing my Javascript from a namespace?