[Javascript] Includes and relative paths?

Phil Winstanley p_winstanley at creations.co.uk
Tue Jul 3 11:19:18 CDT 2001


Easy way to sum it up

It's a 'Server Side' Include.
 

__________________________________________

Phil Winstanley
Software Creations (Holdings) Ltd

"The client will change their minds. Its not because they are lower forms of
life, they just are never clear on what they want." 
___________________________________________
ICQ: 29163700
http://www.creations.co.uk/
phil.winstanley at creations.co.uk


-----Original Message-----
From: Ben Curtis [mailto:Quixote at LaMancha.org] 
Sent: Tuesday, July 03, 2001 5:24 PM
To: javascript at latech.edu
Subject: Re: [Javascript] Includes and relative paths?



> OK, I have a page link in an include file, "/dir1/dir2/page1.asp".
> 
> The include file is in a page at "/dir1/dir3/page2.asp".
> 
> The include file is at "/include/inc_menu_bar.asp".
> 
> When I click the link, where does it 'think' it is?  My testing has 
> left me somewhat more befuddled than usual.  What I need is to have 
> the include file produce the called page regarless of where it is when 
> the link is clicked.  I can do it by using "http:// . . .", but I'd 
> like to avoid that because of development issues.  I don't want to 
> have to rewrite all the links in order to move the pages to 
> production.


To the browser, there is no such thing as an include. Once the server
"includes" the file, the browser only sees plain HTML -- and can't tell the
difference between HTML that was completely coded as-is or HTML that was
assembled from code fragments.

Thus, your browser will react to the link to "/dir1/dir2/page1.asp" on the
page of "/dir1/dir3/page2.asp" as if you simply coded that link onto that
page. The include is confusing you. Let it go... :)

+Ben Curtis
...just this guy, you know?







_______________________________________________
Javascript mailing list
Javascript at LaTech.edu http://www.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010703/43fe2c15/attachment.htm>


More information about the Javascript mailing list