0

For example, I am executing "index.html"

Something like this:

var filename = $.getFileName();

alert(filename);

Is it possible to get "index.html" as result in alert?

  • possible duplicate: http://stackoverflow.com/questions/13317276/jquery-to-get-the-name-of-the-current-html-file – devqon Jan 07 '15 at 11:37

1 Answers1

1
var name = window.location.href.substr(window.location.href.lastIndexOf("/")+1);
Jack hardcastle
  • 2,748
  • 4
  • 22
  • 40