Jump to content

Photo

HTML appending the current URL to a link on the page.


  • Please log in to reply
2 replies to this topic

#1 Tseng

Tseng

    MMmmmmm Simpsonized

  • Members
  • Real Name:Kris

Posted 05 August 2009 - 08:17 AM

Wondering how to add the current HTML address on the page to a link. For instance, I am trying to add the code to validate my page via a button in the footer. Here is the code the W3C gives for using the buttons.

CODE

<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
        src="http://www.w3.org/Icons/valid-html401-blue"
        alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
  </p>


Now when I try that the page says I need the referer tag. I dunno how to enter this into my HTML so that it is correct for every page. Are there any ways I can make this code work using another type of link address, or adding some sort of variable that is defined as the web address of the current page? Stumped on how to do this. My Web Developer Toolbar comes with tools that will validate by clicking the option, but the address for that is:

CODE

http://validator.w3.org/check?verbose=1&uri=


I tried using that but it doesn't work either. I am assuming the toolbar has some sort of variable for the page address. icon_shrug.gif

#2 nicklegends

nicklegends

    Trofessional Pransposer

  • Contributors
  • Real Name:Ed
  • Pronouns:He / Him

Posted 06 August 2009 - 06:27 AM

Perhaps I'm misunderstanding you, but you should not need to change "referer" to anything; it automatically checks whatever page you clicked the button on. If you must use another method, you can use the JavaScript variable window.location to retrieve the current address.

#3 Tseng

Tseng

    MMmmmmm Simpsonized

  • Members
  • Real Name:Kris

Posted 06 August 2009 - 12:31 PM

Hmm For some reason it didn't work before. Works fine now lol

Thanks for the help nicklegends.

A mod can close this now icon_razz.gif


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users