Naked Science Forum
Non Life Sciences => Geek Speak => Topic started by: Atomic-S on 21/03/2012 04:05:13
-
I understand that to make a link from within a web page to another, one can include an absolute reference like HREF="http://any-web-site.com/page1.html" . If one is the web master of any-web-site.com , the person would simply use HREF="page1.html" (within the calling page, which could be page2.html). If the page to be linked to is in a subfolder of the same site, then a relative reference of this form is used: HREF="subfolder/page3.html" . So far, so good, But here is where things get complicated: What if the calling page is already in the subfolder, but the called page is in the root folder? I.e., calling from http://any-web-site.com/subfolder/page3.html to http://any-web-site.com/page1.html ?
I have looked through my book but I can find no format to do this using a relative expression. Is a relative expression possible, for linking up the chain into the root folder; or must the entire absolute URL be specified in orde to do this?
-
Windows server
href="..\page.html"
UNIX server
href="../page.html"
The two dots mean "directory above"
and one dot for each "dir" above but generally a system only supports 3 dots at the most so after that you must be aware where the "referrer" this.url or this.location or this.parent.location is in javascripting.
With server side scripting such as PHP PERL or JSP the exact location of dynamic pages can be found and used to produce the URL level required.
-
Thanks; this is helpful. Also I did not know that there is a difference here between Windows and Unix servers, which might explain a few other things.
-
Plenty, with Win you must write (binmode) pragma on a file handle in PERL and assign binary file open for read - write or you damage the system. flock16 does not exist. and as for
paths both win and unix are / forward slash in web pages.