envjs / env-js

A pure-JavaScript browser environment.
http://www.envjs.com/
87 stars 19 forks source link

Do not reload page if location.href has not changed #25

Open orslumen opened 13 years ago

orslumen commented 13 years ago

If the document location is set to a similar URL, do not reload the page.

To fix this I added the following line of code, but I can imagine the URL comparison can be optimized (e.g. by removing blanks at the end of the url):

set href(url) {
  if (url === $url || url+'#' === $url || url === $url+'#') { return; }
  ...
}

See https://github.com/orslumen/env-js/commit/a72ff2ea298fd3a06ac4ebdf29330f2ab68c0b4a