Showing the html?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hymer

    Showing the html?

    Hello,

    I am trying to create the html that someone would copy and paste to create a
    link to our site. I want them to see the entire code and wrote the following
    html:

    <p>&lt;p>&lt; a href="http://www.mysite.com" Usability, User Interface
    Design, &amp; Ergonomics &lt;/a>
    - Internet Resources &amp; Consulting by Usernomics.&lt;/p>
    </p>

    This works fine except for the "&". I want the "&amp;" to show rather than
    "&".
    Can someone tell me what I have to do to permit the "&amp;" to show?

    Thanks,

    Bob


  • Els

    #2
    Re: Showing the html?

    Hymer wrote:
    Can someone tell me what I have to do to permit the "&amp;" to show?
    &amp;amp;

    :-)

    --
    Els http://locusmeus.com/
    accessible web design: http://locusoptimus.com/

    Now playing: Shabby Tiger - Slow Down

    Comment

    • Jukka K. Korpela

      #3
      Re: Showing the html?

      Scripsit Hymer:
      I am trying to create the html that someone would copy and paste to
      create a link to our site.
      If you don't know that, and you don't know how to check authoritative
      specifications on such matters, is your code really worth copying?
      <p>&lt;p>&lt; a href="http://www.mysite.com" Usability, User Interface
      Design, &amp; Ergonomics &lt;/a>
      - Internet Resources &amp; Consulting by Usernomics.&lt;/p>
      </p>
      This raises many questions. Why do you use paragraph markup for something
      that is not a paragraph, or even a complete sentence? Why should people who
      copy the code use paragraph markup? Why the leading and trailing spaces in
      the link text? (The latter probably has an impact on rendering.) Why do you
      use the ASCII hyphen-minus character and not a dash character?

      And why do you misrepresent the content of http://www.mysite.com ? Did you
      even check what it is?
      This works fine except for the "&".
      For some odd values of "work".
      I want the "&amp;" to show rather than "&".
      Why? It might actually confuse people. It is true that it is generally
      advisable (and obligatory in XHTML) to "escape" any occurrence of "&" as
      data character, but a) your code isn't exemplary anyway, b) if people really
      need your help to set up a simple link, they might get confused with
      "&amp;", and c) an "&" when followed by a space works well in browsers (and
      by classic HTML rules).

      But yes, you _can_ make "&amp;" to show by writing e.g. "&amp;amp;" or (if
      that confuses _you_) alternatively "&#38;amp;" .

      --
      Jukka K. Korpela ("Yucca")


      Comment

      • Hymer

        #4
        Re: Showing the html?

        >
        >I am trying to create the html that someone would copy and paste to
        >create a link to our site.
        >
        If you don't know that, and you don't know how to check authoritative
        specifications on such matters, is your code really worth copying?
        >
        ><p>&lt;p>&lt ;a href="http://www.mysite.com" Usability, User Interface
        >Design, &amp; Ergonomics &lt;/a>
        >- Internet Resources &amp; Consulting by Usernomics.&lt;/p>
        ></p>
        >
        This raises many questions. Why do you use paragraph markup for something
        that is not a paragraph, or even a complete sentence? Why should people
        who copy the code use paragraph markup? Why the leading and trailing
        spaces in the link text? (The latter probably has an impact on rendering.)
        Why do you use the ASCII hyphen-minus character and not a dash character?
        >
        And why do you misrepresent the content of http://www.mysite.com ? Did you
        even check what it is?
        >
        >This works fine except for the "&".
        >
        For some odd values of "work".
        >
        >I want the "&amp;" to show rather than "&".
        >
        Why? It might actually confuse people. It is true that it is generally
        advisable (and obligatory in XHTML) to "escape" any occurrence of "&" as
        data character, but a) your code isn't exemplary anyway, b) if people
        really need your help to set up a simple link, they might get confused
        with "&amp;", and c) an "&" when followed by a space works well in
        browsers (and by classic HTML rules).
        >
        But yes, you _can_ make "&amp;" to show by writing e.g. "&amp;amp;" or (if
        that confuses _you_) alternatively "&#38;amp;" .



        OK Jukka, you have taken me to task. As you can see, I don't know html very
        well. Of course, that's why I asked the question, albeit the wrong one.

        While I don't know the correct coding, the user will probably know even
        less. I would like to get the correct coding to offer that person to make it
        easy to copy/paste.

        Can you suggest the correct coding for this purpose?

        Thanks,

        Bob

        P.S. I did not check mysite. Sorry. I was just trying to not publicize my
        URL inappropriately .


        Comment

        • scripts.contact@gmail.com

          #5
          Re: Showing the html?

          On Mar 15, 9:20 am, "Hymer" <ergobob@soni c[REMOVE].netwrote:
          Hello,
          >
          I am trying to create the html that someone would copy and paste to create a
          link to our site. I want them to see the entire code and wrote the following
          html:
          >
          here is a simple solution [but requires js]-

          <p id="insHere">En able JS $=( </p>

          <script type="text/javascript">
          ELEM=document.g etElementById(" insHere")
          TeXt='<p><a href="http://www.mysite.com" Usability, User Interface
          Design, & Ergonomics </a- Internet Resources & Consulting by
          Usernomics.</p>';
          if(ELEM.textCon tent===undefine d)
          ELEM.innerText= TeXt
          else
          ELEM.textConten t=TeXt
          </script>

          Comment

          • Jukka K. Korpela

            #6
            Re: Showing the html?

            Scripsit scripts.contact @gmail.com:
            here is a simple solution [but requires js]-
            Well, the original question was ill-advised (someone is trying to give
            others instructions on putting stuff on their pages without knowing HTML),
            but that's not really an excuse for getting that nasty.

            Maybe bogus questions deserve bogus answers, but this time, the question
            wasn't bogus. The person is just trying to do something that shouldn't be
            doing.

            --
            Jukka K. Korpela ("Yucca")


            Comment

            Working...