在Chrome上的XML错误,但在FF上很好


XML error on Chrome but is fine on FF?

我使用PHP检索数据并将数据作为RSS提要发布。我的脚本在Firefox上工作得很好,但在Chrome上不行。

这适用于Firefox,但不适用chrome:

getData.php?id=1744225&odds=1

这适用于Chrome:

getData.php?id=1744225&odds=1

Chrome似乎需要URL中完整的&号代码:

"&"

完整的URL在主干模板中呈现,如下所示:

<a href="/php/getData.php?id=<%= model.id %>&amp;odds=1" target="_blank"><i class="icon-rss" id="rss"></i></a>

在Chrome上这是我得到的错误:

This page contains the following errors:
error on line 1 at column 1066: EntityRef: expecting ';'    
Below is a rendering of the page up to the first error.

如何防止在Chrome上产生此错误?看起来模板中有正确的代码。

我曾经遇到过这个问题——我很懒,设置了一个javascript事件监听器,将'&'s替换为&