My blog has moved!

Visit http://blog.adamroderick.com/ and update your bookmarks.

Wednesday, July 8, 2009

Get Current Page Name Using JavaScript

Quick function to return only the current page name, using JavaScript:


function CurrentPageName() {
return document.location.href.substring(
document.location.href.length
, document.location.href.lastIndexOf('/') + 1
);
}

Labels:

1 Comments:

Anonymous Anonymous said...

Hi,

Thanks for the info.

November 12, 2009 at 8:58 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home