I don\'t understand why I get an error message using the substring method to declare a variable.
I want to use the first part of the URL in a comparison.
Sit
document.location is an object, not a string. It returns (by default) the full path, but it actually holds more info than that.
document.location
Shortcut for solution: document.location.toString().substring(2,3);
document.location.toString().substring(2,3);
Or use document.location.href or window.location.href
document.location.href
window.location.href