Internet explorer 搜索在IE 10上不起作用,但在Chrome、Safari、Opera和Firefox上效果很好
当它搜索IE 10上的数据库英语字符时,它非常有效,但当它搜索数据库以查找希腊字符时,没有任何东西显示为文本。这只发生在IE上Internet explorer 搜索在IE 10上不起作用,但在Chrome、Safari、Opera和Firefox上效果很好,internet-explorer,internet-explorer-10,Internet Explorer,Internet Explorer 10,当它搜索IE 10上的数据库英语字符时,它非常有效,但当它搜索数据库以查找希腊字符时,没有任何东西显示为文本。这只发生在IE上 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="js/textinputs_jquery.js"
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/textinputs_jquery.js"></script>
<script type="text/javascript" src="js/textinputs_jquery_src.js"></script>
<script>
$(document).ready(function(){
$("#comp_text").live('input paste',function(){
var str=document.getElementById("comp_text");
if (str.value.length <3){
return false;
}
var twidth=str.offsetWidth;
$('#txtHint').width(twidth);
$('#txtHint').load('gethint.php?q='+str.value);
});
$(".add").submit( function(){
if($('#company').length){
return true;
}else{
alert("");
return false;
}
});
});
function showHint(str)
{
if (str.length==0)
{
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 (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+str,true);
xmlhttp.send();
}
function set_val(str, company){
document.getElementById('comp_text').value= str;
document.getElementById('txtHint').innerHTML="";
document.getElementById("customer_place").innerHTML='<input type="hidden" id="company" value="'+company+'">';
}
function cust_control(){
if (document.getElementByName('company')){
alert ("");
return false;
}else
return true;
}
</script>
<form method=\"post\" name=\"addn\" class=\"add\" action=\"do_insert.php\">
<input type="text" id="comp_text" onkeyup="showHint(this.value)" name="company" size="20" style="text-align: center; font-size: 13px;"/>
<div id="txtHint"></div>
<div id="customer_place"></div>
</form>
$(文档).ready(函数(){
$(“#comp_text”).live('输入粘贴',函数()){
var str=document.getElementById(“comp_text”);
如果(str.value.length 0){
$response.='';
while($row=mysql\u fetch\u数组($result)){
$response.='.$row['company'].';
}
$response.='';
回音$应答;
}否则{
}
更换
xmlhttp.open(“GET”,“gethint.php?q=“+str,true”);
具有
xmlhttp.open(“GET”,“gethint.php?q=“+encodeURIComponent(str,true));
解决了这个问题
$q=$_GET["q"];
$response='';
$query="SELECT uid, company FROM users where company like '".$q."%' and userid='$userid' order by company";
mysql_query("set character set 'utf8'");
$result=mysql_query($query);
if (mysql_num_rows($result) > 0) {
$response.='<table>';
while ($row=mysql_fetch_array($result)){
$response.='<tr><td onclick="set_val(\''.$row['company'].'\', \''.$row['uid'].'\')">'.$row['company'].'</td></tr>';
}
$response.='</table>';
echo $response;
}else{
}