SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Location
    United States
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Inserting a Hyperlink

    http://books.google.com/books?id=cn0M3BekNDgC&dq=the+tempest&printsec=frontcover&source=bl&ots=r4Kk2lbApB&sig=gV07NmOljqnq8c-4THQbqEi0-mM&hl=en&ei=0IW2Su-jJorANZOxzdoO&sa=X&oi=book_result&ct=result&resnum=9#v=onepage&q=&f=false

    Hi, I am working on an assignment for class. We are making a sample web page about The Tempest. I have the entire assignment completed. The last thing I had to do was add some links to the web page where I got the content from. Also, the entire web page must validate as Transitional.

    The problem is that when I insert the following link into my web page, the validator fails 63 times on this link. The rest of the document is 100% correct. I'm not sure why I cannot include this link in my web page.

    It leads to a book that I used to get some content for the website. So it needs to be included in my assignment.

    Does anyone have any idea what I'm doing wrong?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The '&' character has special meaning in HTML. It signals the beginning of a named entity reference (e.g.,  ) or a numeric character reference (e.g.,  ).

    Therefore it must be escaped as & when it's supposed to appear literally in the content or in attribute values. (The exceptions are the script and style elements in HTML – but not in XHTML.)

    So you just need to replace every occurrence of '&' with & in your URL.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Member sophia8's Avatar
    Join Date
    May 2008
    Location
    Scotland
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alternatively, shorten such long links with a URL from bit.ly or tinyurl.com
    It will be a lot easier, and lessen code bloat.

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Also there is a space in your URL which will cause problems, note the below:
    http://books.google.com/books?id=cn0M3BekNDgC&dq=the+tempest&printsec=frontcover&source=bl&ots=r4Kk2lb ApB&sig=gV07NmOljqnq8c-4THQbqEi0-mM&hl=en&ei=0IW2Su-jJorANZOxzdoO&sa=X&oi=book_result&ct=result&resnum=9#v=onepage&q=&f=false


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
  •