在referer主页上加载文件Javascript

在referer主页上加载文件Javascript,javascript,php,html,ajax,Javascript,Php,Html,Ajax,我的剧本是这样的: function showBrand(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHtt

我的剧本是这样的:

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();
}
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);
            }
        });
    });
});
但是get file modul=sgob未使用文件javascript引用。。所以我不能运行复选框全选


是的,我已经解决了这个问题,我终于用javascript更改了代码,如下所示:

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();
}
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更改了代码,如下所示:

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();
}
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可运行复选框全选