我在标签中渲染这行代码以<pre>
在屏幕上显示为普通文本:
<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=7&size=700x540&sensor=false$center=London, England&markers=London, England|Leicester, England|">
但是它在多个浏览器中被错误呈现为:
<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=7&size=700x540&sensor=false¢er=London, England&markers=London, England|Leicester, England|">
由于美分符号的转义码是¢
而不是¢
,我不明白为什么会发生这种情况,而且似乎没有任何方法可以防止它。任何人都可以帮忙吗?
另外,我的文档类型:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
如果有任何区别,这行代码将通过 Javascript 的 innerHTML 方法添加到文档中。