我的脚本是这样的:

function showBrand(str) {
    if (str=="") {
        document.getElementById("txtHint").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else { // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (this.readyState==4 && this.status==200) {
          document.getElementById("txtHint").innerHTML=this.responseText;
        }
    }
    xmlhttp.open("GET","index?modul=sgob&q="+str,true);
    // xmlhttp.open("GET","window.location.href + "?q="+str,true);
    xmlhttp.send();
}

但是获取文件模块作业未与文件javascript ..关联,因此我无法运行复选框全选。
javascript - 在引荐来源网址首页加载文件Javascript-LMLPHP
javascript - 在引荐来源网址首页加载文件Javascript-LMLPHP

最佳答案

是的,我已经解决了这种情况,我终于在javascript中更改了我的代码,如下所示:

jQuery(function() {
    $("#getBus").change(function() {
        var id = $(this).find(":selected").val();
        var dataString = 'action='+ id;

        $.ajax({
            url: "index?modul=sgob",
            data: dataString,
            cache: false,
            success: function(response) {
                /* If Success */
                $("#show-bus").html(response);
            }
        });
    });
});


然后modul = sgob可以运行复选框全选。

javascript - 在引荐来源网址首页加载文件Javascript-LMLPHP

10-07 19:14
查看更多