简体   繁体   English

Ajax通话在Chrome上可以正常使用,但在IE7上不能正常使用

[英]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. 首先,我想说的是,此问题仅在使用Internet Explorer 7时发生,当我使用Chrome时,一切正常。

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. 因此,我遇到的问题是,我得到了一个非常简单的PHP文件,该文件具有用于输入文档编号的输入框,然后具有一个提交按钮,差不多就是这个问题了(我认为)就在我所说的地方使用Ajax的第二个PHP文件(该文件负责查询MYSQL数据库并返回包含一些数据的表和图形),但是当我运行IE7时,调用succes函数后,我什么也没得到:(响应)

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. 如您所见,我已经尝试过该网站上类似线程建议的某些操作,例如使用cache:false,或在每次调用时添加一些随机生成的数据。

Here is a Link to the full PHP file. 这是完整PHP文件的链接

<--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! 因此,在遵循了你们给我的一些建议之后,我终于可以调用另一个PHP文件了,现在的问题是,即使我可以调用它,由于某些原因IE7也不解析PHP脚本返回的内容,这是一个链接到proceso.php文件 ,预先感谢!

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. 在Stack Overflow上已经有一些帖子,其中包含与javascript解析相关的多种解决方案,jQuery不完全支持IE7(但是这可能基于版本)以及html格式被IE7拒绝的方式。 You can find these answers here: 您可以在这里找到以下答案:

jQuery AJAX problem in IE7 (possibly other versions as well) IE7中的jQuery AJAX问题(可能还有其他版本)

jQuery .ajax method in IE7 & IE6 not working but working fine in Firefox IE7和IE6中的jQuery .ajax方法无法正常运行,但在Firefox中可以正常运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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