Link to home
Start Free TrialLog in
Avatar of MinnRick
MinnRickFlag for United States of America

asked on

Rules For Using Relative URLs in Javascript

Hello Experts -
Can someone please give me the quick and dirty on properly structuring relative URLs in javascript, particularly when multiple levels up and/or down the tree are required?  Say, for instance, that in a development environment I'm starting at a file such as this:   \wwwroot\alpha\bravo\charlie.aspx

How would a javascript reference need to be structured that would navigate from that page to get to something like this:   \wwwroot\delta\echo\foxtrot\golf.aspx

Or, from charlie.aspx to this:   \wwwroot\alpha\hotel\india\juliet\kilo.aspx

Are there shortcuts that allow you to go up only one level or two and then down into another branch of the file tree from there (and is it good form to do so), or is it best to go all the way to the root directory and then down from there?  Are there shortcut symbols involved to go up one level and all the way to the root?  I'm sure that this is basic stuff but I've never been able to get my head fully around how it works and what constitutes a best practice.  Thanks in advance.

-- Rick
SOLUTION
Avatar of basicinstinct
basicinstinct
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MinnRick

ASKER

Thanks all - very helpful.