devote / HTML5-History-API

HTML5 History API expansion for browsers not supporting pushState, replaceState
http://spb-piksel.ru
MIT License
1.02k stars 182 forks source link

Comments in examples of usage #67

Closed mkhazov closed 9 years ago

mkhazov commented 9 years ago

I suppose, that comment in examples is outdated? In previous version line below contained document.location, but now it's window.location.

    /*
     * Note, this is the only difference when using this library,
     * because the object document.location cannot be overriden,
     * so library the returns generated "location" object within
     * an object window.history, so get it out of "history.location".
     * For browsers supporting "history.pushState" get generated
     * object "location" with the usual "document.location".
     */
    var location = window.history.location || window.location;
devote commented 9 years ago

Hi,

There is no difference, as the document.location and window.location identical, document.location is an alias of window.location

But if you so desire, I can fix comment

mkhazov commented 9 years ago

As you see fit) I just thought that this little mismatch in code and in comment is a bit confusing

devote commented 9 years ago

Okay, I will correct the comment)