开发者

Mediawiki + AJAX + IE = broken

开发者 https://www.devze.com 2022-12-14 04:31 出处:网络
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 param

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).

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).

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...

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

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

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.

Thanks in advance, Tim


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消