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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

website root 1

Status
Not open for further replies.

jshurst

Programmer
Oct 27, 2004
1,158
US
I kinda doubt this is possible, but is there a way to set the path in JavaScript to the root of the site?

What I mean is this. In asp.net you can specify a link like "~/Reports/yourpage.aspx", which will always go to the root (like ).

I know that I can go up folders with "../", but I need to be able to go to the root.

Thanks,

J
 
Just prefixing your path with / should do it.
In other words /myfile.htm would load myfile.htm from the root of the web site.
This is not the root of the server of course.

For anything else you will probably need to use server-side code to return the root path value.

At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top