Click to See Complete Forum and Search --> : Setting just the page name as a var


Spectrum
04-07-2003, 09:48 PM
I am trying to get only the page file name as a variable so I can us it later. I can get the entire URL, of course, but I just want the file name itself. For example, in a URL of http://www.server.com/web/dir1/page.html, I just want to be able to get "page.html" as a variable.

Is there anyway I can stip out everything but the page file name?

Spectrum
04-07-2003, 10:23 PM
Many, many thanks. I wasn't aware of the lastIndexOf() method. That helps a ton.