English 中文(简体)
Mediawiki + AJAX + IE = broken
原标题:

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.

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签