Posted By

ozke on 12/02/09


Tagged

url String hash


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

ozke
matt0309


Get URL without the hash


 / Published in: JavaScript
 

  1. var url = window.location.href;
  2. var hash = window.location.hash;
  3. var index_of_hash = url.indexOf(hash) || url.length;
  4. var hashless_url = url.substr(0, index_of_hash);

Report this snippet  

You need to login to post a comment.