Click here to get back home

Showing the html?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Showing the html? Hymer 03-15-2007
---> Re: Showing the html? Jukka K. Korpel...03-15-2007
  `--> Re: Showing the html? Jukka K. Korpel...03-16-2007
Posted by Hymer on March 15, 2007, 11:20 am
Please log in for more thread options


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



Posted by Els on March 15, 2007, 11:30 am
Please log in for more thread options


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

Posted by Jukka K. Korpela on March 15, 2007, 11:57 am
Please log in for more thread options


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")
http://www.cs.tut.fi/~jkorpela/


Posted by Hymer on March 15, 2007, 9:31 pm
Please log in for more thread options


>
>> 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.



Posted by scripts.contact on March 15, 2007, 11:42 pm
Please log in for more thread options


> 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">Enable JS $=( </p>

<script type="text/javascript">
ELEM=document.getElementById("insHere")
TeXt='<p><a href="http://www.mysite.com"> Usability, User Interface
Design, & Ergonomics </a> - Internet Resources & Consulting by
Usernomics.</p>';
if(ELEM.textContent===undefined)
ELEM.innerText=TeXt
else
ELEM.textContent=TeXt
</script>


Similar ThreadsPosted
Showing html code in a web page April 3, 2005, 5:56 pm
Problem with image map showing February 10, 2005, 2:27 pm
External Links not showing. June 24, 2005, 10:21 pm
CSS: border-bottom not showing up??? May 7, 2007, 5:41 am
Showing target of a link inline November 15, 2005, 6:00 pm
POSTing form/showing results within div March 13, 2008, 7:34 am
w3c validation icon not showing in MSIE (but OK in FireFox) May 25, 2005, 4:06 pm
Showing hidden answer when question clicked? June 13, 2005, 1:42 pm
the web browser asks me if I want to download my index.htm file,instead of showing it July 30, 2004, 2:29 pm
Re: the web browser asks me if I want to download my index.htm file,instead of showing it July 30, 2004, 7:05 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap