请跪下我的 Bug——在 IE 中使用 Flex 3、OpenX 时出现 XML 解析器错误
我正在尝试让 Flex 3 和 OpenX 协同工作。在 Safari 和 Firefox 中一切都运行良好。但是,我在 Internet Explorer 中遇到 XML 解析器错误,这让我想拔掉头发喝松节油。
我已尽力简化问题。基本上,我获取 adReturn 然后将其转换为 xml。
adReturn = '<adXMLReturn>' + adReturn + '</adXMLReturn>';
xmlReturn = new XML(adReturn);
我不认为IE喜欢adReturn,如下:
"<adXMLReturn>
<SCRIPT type=text/javascript><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://www.dcscore.com/openx/www/delivery/ajs.php':'http://www.dcscore.com/openx/www/delivery/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=4");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></SCRIPT>
<SCRIPT type=text/javascript src="http://www.dcscore.com/openx/www/delivery/ajs.php?zoneid=4&cb=42464397192&charset=utf-8&loc=http%3A//www.dcscore.com/"></SCRIPT>
<A href="http://www.dcscore.com/openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=80291ee9b3__oadest=http%3A%2F%2Fwww.dcscore.com" target=_blank><IMG title="" border=0 alt="" src="http://www.dcscore.com/openx/www/delivery/ai.php?filename=mybanner.png&contenttype=png" width=468 height=60></A>
<DIV style="POSITION: absolute; VISIBILITY: hidden; TOP: 0px; LEFT: 0px" id=beacon_80291ee9b3><IMG style="WIDTH: 0px; HEIGHT: 0px" alt="" src="http://www.dcscore.com/openx/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=4&loc=http%3A%2F%2Fwww.dcscore.com%2F&cb=80291ee9b3" width=0 height=0></DIV><NOSCRIPT></NOSCRIPT></adXMLReturn>"
有人看到adReturn有问题吗?帮助!
谢谢你!
-拉克斯米迪
I'm trying to get Flex 3 and OpenX to work together. Everything works great in Safari and Firefox. But, I get an XML parser error in Internet Explorer, which makes me want to rip my hair out and drink turpentine.
I've tried to simplify the problem as best I can. Basically, I take the adReturn and then turn it into xml.
adReturn = '<adXMLReturn>' + adReturn + '</adXMLReturn>';
xmlReturn = new XML(adReturn);
I don't think that IE likes adReturn, which is below:
"<adXMLReturn>
<SCRIPT type=text/javascript><!--//<![CDATA[
var m3_u = (location.protocol=='https:'?'https://www.dcscore.com/openx/www/delivery/ajs.php':'http://www.dcscore.com/openx/www/delivery/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=4");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></SCRIPT>
<SCRIPT type=text/javascript src="http://www.dcscore.com/openx/www/delivery/ajs.php?zoneid=4&cb=42464397192&charset=utf-8&loc=http%3A//www.dcscore.com/"></SCRIPT>
<A href="http://www.dcscore.com/openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=80291ee9b3__oadest=http%3A%2F%2Fwww.dcscore.com" target=_blank><IMG title="" border=0 alt="" src="http://www.dcscore.com/openx/www/delivery/ai.php?filename=mybanner.png&contenttype=png" width=468 height=60></A>
<DIV style="POSITION: absolute; VISIBILITY: hidden; TOP: 0px; LEFT: 0px" id=beacon_80291ee9b3><IMG style="WIDTH: 0px; HEIGHT: 0px" alt="" src="http://www.dcscore.com/openx/www/delivery/lg.php?bannerid=1&campaignid=1&zoneid=4&loc=http%3A%2F%2Fwww.dcscore.com%2F&cb=80291ee9b3" width=0 height=0></DIV><NOSCRIPT></NOSCRIPT></adXMLReturn>"
Does someone see a problem in adReturn? Help!
Thank you!
-Laxmidi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是如此明显 - 我很惊讶你可能会错过它,因为 XML 如此美丽且易于阅读 - 这是有史以来最好的东西 :P
好吧,开个玩笑吧,当出现问题时,XML 很丑陋,读起来很痛苦,这就是为什么有 JSON 和更好的 YAML——一种高效存储和传输数据的方法,对人类和计算机来说都很容易处理。
不管怎样,我是这样发现问题的: XML Validator 下次使用它以避免丢失你的头发太早了。
It's so obvious - I'm astounded that you could you have missed it because XML is so beautiful and easy to read - it's the best thing ever :P
OK all kidding aside XML is ugly and torture to read through when there's a problem that's why there's JSON and even better YAML - a way to efficiently store and transfer data that's easy for both humans and computers to deal with.
Anyway, here's how I found the problem: XML Validator Use that next time to avoid losing your hair too early in life.