Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display filename on page

Status
Not open for further replies.

mobius1983

Technical User
Jul 7, 2002
45
GB
Hi everyone,

Hope someone can help, I need to display the name of the file that is being displayed on all the pages of my company intranet (e.g index.htm, contents.htm)

I can get it using the window.location.href and then only using any text that is after the last '/'. This works ok apart from on the first page because you do not specify the page name (e.g returns nothing because there is no page name specified in the URL).

I am also not sure if this method would work if the page was inside a frameset.

If anyone knows of a way you can get the page filename I would be forever in your debt!

Thanks in advance
Nick.
 
Nick,

Do you have any server-side languages available to you? Certainly what you ask is possible in JSP (and most likely ASP and PHP too)... You say you are using this for the company intranet, so you could use something like Tomcat or IIS to make this possible.

As far as I know, however, it isn't possible (client-side) to tell the filename of a default document (for example, default.htm, index.html, etc) that is loaded when you visit a URL without specifying a filename.

Hope this helps,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top