为您找到"
[憨笑]&
"相关结果约100,000,000个
So you should be replacing your ampersands with & when writing a URL in your markup. Note that replacing & with & is only done when writing the URL in HTML, where "&" is a special character (along with "<" and ">").
HTML Character Entities Some characters are reserved in HTML. If you use the less than (<) or greater than (>) signs in your HTML text, the browser might mix them with tags. Entity names or entity numbers can be used to display reserved HTML characters. Entity names look like this:
An explanation of when to use encoded ampersands (&) in HTML and Javascript and when not to encode them.
An ampersand written in HTML without the semicolon will look like this &. An ampersand properly written in HTML with the semicolon at the end will look like this & I understand these special characters, but what about the ISO Latin-1 special characters?
The ampersand is no exception. Here's an example of what is required in order to display the code required to output an ampersand symbol. Note that the amp; bit needs to be included twice. Without including it twice, a single ampersand symbol would rendered and that's all.
What is & is the first place? Because one symbol can mean different things in coding (in general), so there needs to be a way to differentiate one kind from another.
In SGML, XML, and HTML, the ampersand is used to introduce an SGML entity, such as (for non-breaking space) or α (for the Greek letter α). The HTML and XML encoding for the ampersand character is the entity &. 40 This can create a problem known as delimiter collision when converting text into one of these markup languages.
From w3c: Authors should use & (ASCII decimal 38) instead of "&" to avoid confusion with the beginning of a character reference (entity reference open delimiter).
I understand the rationale behind why most of the HTML character Entities were created, but I don't understand the purpose behind the ampersand HTML entity. & contains more bits than a &
1 It's not just SO that formats & like that, it's all web sites as this is a feature of HTML. They're called "entities" and consist of a sequence of characters beginning with an ampersand and ending with a semicolon. They're a way of describing a character in situations where using the literal character is undesirable.