Jquery ajax:点击功能在IE中不起作用

时间:2013-09-16 18:43:21

标签: ajax internet-explorer jquery

我有三个标签,每个标签上都有很多不同的类别。单击每个获取数据库的结果。我使用jquery和ajax函数php来显示结果。它工作得很好,但它在IE中打破,现在目前它在IE中不起作用。如果我刷新IE,它会显示结果,否则没有。

以下是在标签中点击其中一个类别时的代码。

$(document).ready(function () {
    $.ajaxSetup({
        cache: false
    });
    window.onload = my_code();

    $(".my_link_3").click(function (event) {
        event.preventDefault();
        search_ajax_way_3(this.id);
    });
});

function search_ajax_way_3(blockId) {
    $("#search_results_3").show();

    var search_this = $("#search_query").val();
    $.post("../../../php/search_1.php", {
        searchit: search_this,
        'blockId': blockId
    }, function (data) {
        $("#display_results_3").html(data);
    })
}

function search_ajax_way_base(blockId) {
    $("#search_results_1").show();

    var search_this = $("#search_query").val();
    $.post("../../../php/search_1.php", {
        searchit: search_this,
        'blockId': blockId
    }, function (data) {
        $("#display_results_1").html(data);
    })
}

function my_code() {
    search_ajax_way_base("rad1");
}  

0 个答案:

没有答案
相关问题