internet explorer - Search is not working on IE 10, but works great on Chrome, Safari, Opera, Firefox -


it works great when searches database english characters on ie 10 nothing shows text when searches database find greek characters. happens 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> <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 ie7+, firefox, chrome, opera, safari   xmlhttp=new xmlhttprequest();   } else   {// code 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> 

and gethint.php ...

$q=$_get["q"]; $response='';  $query="select uid, company users company '".$q."%' , userid='$userid' order 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{ } 

replacing xmlhttp.open("get","gethint.php?q="+str,true); xmlhttp.open("get","gethint.php?q="+encodeuricomponent(str,true)); solves problem ...


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -