I can not get this code to work on Internet Explorer 11. I know this segment is causing the problem. If I upload my file with this code active, IE 11 dispays entire sections of
You should use correct selector:
For this HTML:
<div class="ImageContainer">
<a href="#1234"><img class="selected" src="" /></a>
</div>
JS:
$('img').removeClass('selected');
$('a[href="#1234"]', '.ImageContainer').addClass('selected');
OUTPUT:
<div class="ImageContainer">
<a href="#1234" class="selected"><img src="" class=""></a>
</div>
Tested on IE 11 and FF 42:
jsfiddle: http://jsfiddle.net/ghorg12110/h1xtty4n/
The issue is on how IE treats hash. It doesn't default to empty string like the other browsers, it defaults to '#'. Also rather than setting hash, you should set location for reliability in IE.
hash = window.location.hash !== '' ? window.location.hash: '#about';
becomes
hash = window.location.hash;
if (hash !== '' || hash !== '#') {
hash = '#about';
window.location = hash;
}
The markup was not rendering because it was not resetting the hash on entry and giving an error message that '#' was not a valid selector for the filter.