SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help Interpreting an Anchor Tag

    I recently took over managing a non-for-profit website and am trying to understand what the previous designer did. I have no problem understanding any of the html or css, however, I can't figure out the syntax in an Anchor Tag. It looks like this:

    <a href="stuff.html?SID=af6f7b8287aaf83d48127e9dd3019091#Donations">Current Year</a>

    What does the "?" indicate and why is the page location ID expressed in hex? The DOCTYPE is declared as XHTML1.1.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2008
    Location
    NC
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're looking at parameters being passed via URL. From various places around the net:
    A URL parameter is a name/value pair appended to a URL. The parameter begins with a question mark (?) and takes the form name=value. If more than one URL parameter exists, each parameter is separated by an ampersand (&). The following example shows a URL parameter with two name/value pairs:

    http://server/path/document?name1=value1&name2=value2

    URL parameters let you pass user-supplied information from the browser to the server. When a server receives a request, and parameters are appended to the URL of the request, the server puts the parameters at the disposal of the requested page before serving that page to the browser.
    As to what the name/value pair SID denotes, that's most likely application specific.

  3. #3
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The ? indicates the start of a query string. It has a name-value pair, where SID is the name, and the junk afterwards is the value. It's probably a hash for something that can be found in the database on the backend.

    The hash just indicates a location on the page. Somewhere on the page there will be an element with the id="Donations". That #Donations in the URI just tells the browser to jump to that point in the page immediately, without the user having to scroll down.

  4. #4
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for the explanation. It seems like this is overkill as there are no server side applications involved, the anchor is just referencing another page and page location on the site. BTW, your explanation was excellent.


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
  •