什么是& amp用于 [英] What is &amp used for
问题描述
我不知道为什么& amp;
插入,它有什么区别?
www.testurl.com/test?param1=test&current=true
与
www.testurl.com/test?param1=test¤t=true
&
是开始字符引用的HTML。 code>& amp; 是和号的字符引用。
& current ;
不是一个标准的字符引用,所以是一个错误(浏览器可能会尝试执行错误恢复,但不应该依赖于此)。
如果您使用字符引用来表示真实字符(例如& trade;
),那么它(™)将出现在URL中,而不是您想要的字符串。 / p>
(注意取决于HT的版本您使用的ML,您可能必须以;
结束字符引用,这就是为什么& trade =
会被视为&trade ;.如果下一个字符是非单词字符(例如 =
),但某些浏览器(Hello Internet Explorer)对此有问题,则HTML 4允许忽略它。 / p>
Is there any difference in behaviour of below URL.
I dont know why the &
is inserted, does it make any difference ?
www.testurl.com/test?param1=test&current=true
versus
www.testurl.com/test?param1=test¤t=true
&
is HTML for "Start of a character reference".
&
is the character reference for "An ampersand".
¤t;
is not a standard character reference and so is an error (browsers may try to perform error recovery but you should not depend on this).
If you used a character reference for a real character (e.g. ™
) then it (™) would appear in the URL instead of the string you wanted.
(Note that depending on the version of HTML you use, you may have to end a character reference with a ;
, which is why &trade=
will be treated as ™. HTML 4 allows it to be ommited if the next character is a non-word character (such as =
) but some browsers (Hello Internet Explorer) have issues with this).
这篇关于什么是& amp用于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!