简体   繁体   中英

Ajax call working fine with Chrome but not with IE7

First I want to say that this problem is only happening when using Internet Explorer 7, when I use Chrome everything works just fine.

So, the problem I have is the following, I got a really simple PHP file that has an input box for a document number, then it has a submit button, that is pretty much it, the problem (I think) comes where I call a second PHP file using Ajax (this file is in charge of querying a MYSQL data base and returning a table and a graph with some data) but when I run IE7 I don't get anything after the succes function:(response) is called.

Here is the function where I call the second file:

function realizaProceso(valorDocumento){
    var parametros = {
            "valorDocumento" : valorDocumento
    };
    if ($.browser.msie  && parseInt($.browser.version, 10) === 7) {

        } else {

        }

    $.ajax({
            data:  parametros + "&r=" + Math.random(),
            cache: false,
            url:   'proceso.php',
            type:  'post',
            dataType : 'text',
            beforeSend: function () {

                    $("#resultado").html("Procesando, espere por favor...");
            },
            success:  function (response) {

                    $("#resultado").html(response);
            }
    });

}

As you can see I have already tried some of the things that were suggested on symilar threads on this website, such as using the cache: false, or adding some random generated data on each call.

Here is a Link to the full PHP file.

<--UPDATE-->

So after following some of the suggestions you guys gave me, I can finally call the other PHP file, now the problem is that even thought I can call it, for some reason IE7 is not parsing what the PHP script is returning, here is a Link to the proceso.php file , thanks in advance!

There are already a few posts on Stack Overflow with multiple solutions related to javascript parsing, jQuery not fully supporting IE7 (however this could be version based), and html formatted in a way that IE7 doesn't approve of. You can find these answers here:

jQuery AJAX problem in IE7 (possibly other versions as well)

jQuery .ajax method in IE7 & IE6 not working but working fine in Firefox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM