473,473 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

& and &

I see that many pages have & in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&ID=15
What is difference between & and & and what is better?
May 4 '07 #1
3 2182
& is an & sign when encoded for correct presentation in text so in html
you would say Bill & Ben in your code and it would be presented as Bill
& Ben in the browser. You would only use it in a URL if you wanted to pass
Bill&Ben as an argument. The & sign on the URL is for gluing querystring
parameters together.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Tony" <To*****@gmail.comwrote in message
news:f1**********@magcargo.vodatel.hr...
>I see that many pages have &amp; in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&amp;ID=15
What is difference between & and &amp; and what is better?

May 4 '07 #2
The proper character for an url is & BUT in an HTML document the & character
introduces a character entity. For this reason, when a link is written
inside an HTML document it's better to use &amp; to avoid a possible
confusion. Note that this is an HTML issue, in particular the server will
still see just & (as this is what &amp; means in an HTML document).

See :
http://htmlhelp.com/tools/validator/...ms.html.en#amp

---
Patrice

"Tony" <To*****@gmail.coma écrit dans le message de news:
f1**********@magcargo.vodatel.hr...
>I see that many pages have &amp; in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&amp;ID=15
What is difference between & and &amp; and what is better?

May 4 '07 #3
Hello Tony,

Just to add to partice, read "HTML Document Representation" http://www.w3.org/TR/html4/charset.html
about HTML/URL Encoding

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

TI see that many pages have &amp; in querystring instead &. What is
Tdifference? Can I put page link (url)
Twww.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
Twww.mysite.com/mypage.aspx?lang=EN&amp;ID=15
TWhat is difference between & and &amp; and what is better?
May 4 '07 #4

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

Similar topics

9
by: Collin VanDyck | last post by:
I have a basic understanding of this, so forgive me if I am overly simplistic in my explanation of my problem.. I am trying to get a Java/Xalan transform to pass through a numeric character...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
11
by: Jeremy | last post by:
How can one stop a browser from converting &amp; to & ? We have a textarea in our system wehre a user can type in some html code and have it saved to the database. When the data is retireved...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.