Return to Snippet

Revision: 37092
at December 3, 2010 21:51 by mmstudio


Initial Code
function getFileName() {
	var url = document.location.href;
	url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
	url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
	url = url.substring(url.lastIndexOf("/") + 1, url.length);
	return url;
}

Initial URL

                                

Initial Description

                                

Initial Title
Get the file name of the page

Initial Tags

                                

Initial Language
JavaScript