很短的一段js代码,本地调试正常,传上服务器就不行,请高手指教哪里有错?
<script>functionshowCustomer(str){varxmlhttp;if(str==""){str="";return;}if(window.XML...
<script> function showCustomer(str) { var xmlhttp; if (str=="") { str=""; 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() { //alert(xmlhttp.readyState); if (xmlhttp.readyState==4 && xmlhttp.status==200) { var a = xmlhttp.responseText; document.getElementById("txtHint").innerHTML=a; } } xmlhttp.open("GET","http://网址(这里不让发)/test1.txt",true); xmlhttp.send(); } </script> html代码: <form action="" style="margin-top:15px;"> 请选择: <select name="customers" onchange="showCustomer(this.value)" > <option value="s1">S1</option> <option value="s2">S2</option> </select> </form> <div id="txtHint">在此处列出 ...</div>
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询