链接到MediaWiki + AJAX + IE =破 [英] Mediawiki + AJAX + IE = broken

查看:103
本文介绍了链接到MediaWiki + AJAX + IE =破的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了链接到MediaWiki的扩展,在所有主要浏览器比IE(它出现任何版本)等著作。扩展依赖于MediaWiki的Ajax调用发送xmlhtt prequest与参数,基本上建立一个数据库查询到PHP脚本。该脚本将运行一个查询依据的参数,然后创建一个XML对象(使用PHP的SimpleXML类),然后在浏览器中(只是一个表,大部分)将返回XML的JavaScript来显示。

I have created an extension for mediawiki that works in all major browsers other than IE (any version it appears). The extension relies on mediawiki's ajax wrapper to send an xmlhttprequest with parameters that essentially build a database query to a php script. This script will run a query based on the parameters and then create an XML object (using php's simplexml class) which then returns the XML to javascript for display in the browser (just a table, mostly).

现在所有这些信息,IE浏览器似乎是工作,直到在它试图解析返回的XML的地步。我已经设置了MIME类型为application / xml,我曾尝试与通过谷歌(没有工作)中发现的各种不同的技术加载它。

Now with all that information, IE seems to be working up until the point at which it tries to parse the returned XML. I have set the mime type to application/xml and I have tried loading it with various different techniques found via google (none worked).

这是微不足道的使用非IE浏览器时加载XML解析:

It is trivial to load the XML for parsing when using non-IE browsers:

function callbackHCL(response){
    if (response.readyState == 4) {
        var xmlObj = response.responseXML;
            if (response.status == '200'){
                if (xmlObj !== undefined){
                    //etc...

现在我可以开始使用DOM函数来获取数据。

Now I can start using dom functions to get at data.

我的问题:是否有人对如何解析XML在IE浏览器的任何建议,根据我目前的情况?

My Question: Does anybody have any suggestions on how to parse xml in IE based on my current scenario?

如果你想在tccroninv@gmail.com给我发电子邮件,我可以提供更长的code段,它们是长,我不相信他们会帮助的情况。如果你想我发布更多code,只问为好。

If you would like to email me at tccroninv@gmail.com, I can provide longer code snippets, they are longer and I don't believe they would help the situation. If you would like me to post more code, just ask as well.

在此先感谢, 蒂姆·

推荐答案

我想这可能是你想要的东西:的 http://dean.edwards.name/weblog/2006/04/easy-xml/ 。基本上,IE不返回像其他人的XML文档。需要做一些花哨的脚法,使其正常工作。我敢肯定有一个图书馆,在那里,包装这一切了,所以你不用担心,如果你不想。

I think this might be what you want: http://dean.edwards.name/weblog/2006/04/easy-xml/. Basically, IE doesn't return an XML document like the other guys. Need to do a little fancy footwork to make it work correctly. I'm sure there's a library out there that wraps this all up so you don't have to worry about it if you don't want to.

这篇关于链接到MediaWiki + AJAX + IE =破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆