window.location versus just location
I always use window.location in my code for two principal reasons: It’s a good habit to avoid global variables whenever possible. Using the window. prefix reminds me that the variable is global and that others aren’t. The nature of Javascript’s scoping allows you to override variables set higher up the scope tree. This means that … Read more