Posted By

merrittwjm on 04/29/11


Tagged

javascript location path document href


Versions (?)

get document location


 / Published in: JavaScript
 

Strips the "http://" from the document path

  1. function currentDoc() {
  2. var doc = document.location.href;
  3. var end = (doc.indexOf("?") == -1) ? doc.length : file_name.indexOf("?");
  4. return doc.substring(7, end);
  5. }

Report this snippet  

You need to login to post a comment.