473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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
Mar 15 '07 #1
5 2292
Els
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
Mar 15 '07 #2
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 "&amp;".

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 15 '07 #3
>
>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 "&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.
Mar 16 '07 #4
On Mar 15, 9:20 am, "Hymer" <ergobob@sonic[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">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>

Mar 16 '07 #5
Scripsit sc*************@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")
http://www.cs.tut.fi/~jkorpela/

Mar 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Vishnu | last post by:
I have a strange problem on WindowsXP proffessional with IE6 ,when i try to display a tiff file ,it is not showing ,small red x is comming up. I tried by dowloading latest IE from microsoft but...
2
by: Alex Rybalov | last post by:
Hi, Using IIS 5.0 and sometime some asp pages (absolutely randomly) showing as blank white pages. So far only one way of fixing it - restart whole server. Restarting IIS, or specific web server...
2
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
2
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
10
by: bessington | last post by:
hey all, i'm having a rather bizarre problem.. the image tag i have declared in my xhtml is not showing in safari / konqueror but showing just fine in Firefox, IE, Opera... this is a complete...
7
by: tshad | last post by:
I have a page that is showing as: Page.IsValid = False on postback when my submit button is pressed but none of my Validators have fired so there is no error message. How do I find out what...
1
by: Grimm | last post by:
I am developing an internalk inteface that integrates alot of seperate tools into one interface. The current version uses one Iframe inside a div layer for positioning. Currently the seperate web...
5
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
5
by: sitko | last post by:
Hi, I'm done a little HTML here and there over the years...but nothing professionally. Now I'm working on a project which calls for some simple HTML. Here is my markup, for the life of me I can't...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.