1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 01:36:57 +02:00

[ticket/10737] Improvements over last commit

PHPBB3-10737
This commit is contained in:
Suhaib Khan
2014-02-06 22:18:48 +05:30
committed by Cesar G
parent dad60045b6
commit bc67377400
3 changed files with 28 additions and 68 deletions

View File

@@ -1,30 +1,18 @@
<script>
function showHint(str)
{
if (str.length==0)
if (str.length<3)
{
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
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("livesearch").innerHTML=xmlhttp.responseText;
document.getElementById("livesearch").style.border="0px";
}
}
xmlhttp.open("GET",'{S_LIVE_SEARCH_ACTION}'+"&q="+str,true);
xmlhttp.send();
$.ajax({
url:'{S_LIVE_SEARCH_ACTION}'+"&q="+str,
success:function(result){
$("#livesearch").html(result);
}
});
}
function clearSearch()

View File

@@ -67,30 +67,18 @@
<script>
function showHint(str)
{
if (str.length==0)
if (str.length<3)
{
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
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("livesearch").innerHTML=xmlhttp.responseText;
document.getElementById("livesearch").style.border="0px";
}
}
xmlhttp.open("GET",'{S_LIVE_SEARCH_ACTION}'+"&q="+str,true);
xmlhttp.send();
$.ajax({
url:'{S_LIVE_SEARCH_ACTION}'+"&q="+str,
success:function(result){
$("#livesearch").html(result);
}
});
}
function clearSearch()