So, in my javascript, I have the following code:
var wholeHash = window.location.hash.substring(1);
var data = new Object();
if (wholeHash[0] == '!') { wholeHash = wholeHash.substring(1); }
if (wholeHash[0] == '/') { wholeHash = wholeHash.substring(1); }
When it starts, wholeHashit matters "/search/&&stype=quick". However, wholeHash[0]it does not return anything, which leads to an error wholeHash[0] == '!'. This is only in IE.
Why is this? I know I can use it instead startswith, but I usually wonder why IE cannot get individual characters of a string, while other browsers can.
source
share