SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 1999
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone tell me what the advantages/disadvantages of using relative addressing compared to absolute addressing?

    ie

    <img src="/images/picture.gif">
    or
    <img src="http://www.myserver.com/images/picture.gif">

    I was asked what i prefered to use in an interview and I couldn't really come up with a good answer. Please help. Peace.

    JG

    ------------------
    Tres Dai'lla - Coffeemade Productions!
    Webmaster/Producer/Artist
    http://coffeemade.bombspot.com
    tresstylez@hotmail.com


  2. #2
    mouse monkey
    Join Date
    Dec 1999
    Location
    UK
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I suppose relative linking improves download time very fractionaly as there is less code but only a very little bit.

    I used to use relative linking more before I started using server side technology because I could tests my website offline. I still use it where I can but I don't really think there is many disadvantages/advantages. Although I am sure sombody would prove me wrong.

    Fletch



    [This message has been edited by adamfletch (edited April 27, 2000).]

  3. #3
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally use relative linking, but there are advantages and disadvantages to each.

    Relative linking
    With this the browser must calculate the URL, in other words it must go through a series of processes to discover the URL. It has to know what to add on to what.

    Absolute linking
    This type of linking lets the browser know immediately where to go without it having to find out, like in relative linking. This does however, make a big difference on a site like Yahoo where there were (at last count) 200 links. Let's say the page was at: http://www.marthastewart.com/gardening/picks/topten.htm
    And Martha (lol, the Web designer) wanted to link to http://www.marthastewart.com/ .

    If relative was used, the link would be:
    / (1 character)
    If absolute was used, the link would be: http://www.marthastewart.com/ (29 chars)

    Multiply this example link by 10 times, and you've got 280 characters that could've been saved. That equals .28 kilobytes, or 280 bytes. For extreme-html-optimizers like myself, any savings is good.

    Make your choice!


    ------------------
    Who the heck is Gen. Failure and why does he want to read my hard drive?
    Soon to come: Aspology.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •