| | |
Ajax Search as google?
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2009
Posts: 19
Reputation:
Solved Threads: 0
Hi frnds....
i am trying to do search like google....
my files r here......but it displays error.......plz check the code what the error?
error:
error:'window.google.ac' is null or not an object.
char:1.
line:19.
eg: in a text box type "a"
then "a" related words r displayed...
google.html
i am trying to do search like google....
my files r here......but it displays error.......plz check the code what the error?
error:
error:'window.google.ac' is null or not an object.
char:1.
line:19.
eg: in a text box type "a"
then "a" related words r displayed...
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<?php $file=fopen("http://www.google.com/complete/search?h1=en&js=true&qu=" . $_GET["qu"],"r"); while(!feof($file)){ $d=fgets($file); echo $d; echo "no"; } fclose($file); ?>
google.html
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>google search</title> <script language="javascript"> function getData(dataSource) { var XMLHttpRequestObject = false; if(window.XMLHttpRequest){ XMLHttpRequestObject=new XMLHttpRequest(); }else if(window.ActiveXObject){ XMLHttpRequestObject=new ActiveXObject("Microsoft.XMLHTTP"); } if(XMLHttpRequestObject){ XMLHttpRequestObject.open("GET",dataSource); XMLHttpRequestObject.onreadystatechange=function(){ if(XMLHttpRequestObject.readyState ==4 && XMLHttpRequestObject.status==200){ eval(XMLHttpRequestObject.responseText);} } XMLHttpRequestObject.send(null); } } function connectGoogleSuggest(keyEvent){ var input=document.getElementById("textField"); if(input.value){ getData("google.php?qu=" +input.value); }else{ var targetDiv=document.getElementById("targetDiv"); targetDiv.innerHTML= "<div></div>"; } } function sendRPCDone(unusedVariable,searchTerm,arrayTerm,arrayResults,unusedArray){ var data="<table>"; var loopIndex; if(arrayResults.length !=0){ for(var loopIndex=0; loopIndex < arrayResults.length; loopIndex++){ data +="<tr><td>" + "<a href='http://www.google.com/search?q=" + arrayTerm[loopIndex] +"'>" +arrayTerm[loopIndex] +'</a></td><td>' + arrayResults[loopIndex] + "</td></tr>"; } } data +="</table>" ; var targetDiv=document.getElementById("targetDiv"); targetDiv.innerHTML=data; } </script> </head> <body> <input id="textField" type="text" name="textField" onkeyup="connectGoogleSuggest(event)" /> <div id="targetDiv" ><div></div></div> </body> </html>
![]() |
Similar Threads
- Ajax Search as google? (PHP)
- sample code for form validation using ajax (JavaScript / DHTML / AJAX)
- google ajax search api ( youtube videoBar) (JavaScript / DHTML / AJAX)
- Google API Search Engine Code (JavaScript / DHTML / AJAX)
- Filtered search function on a website (JavaScript / DHTML / AJAX)
- Image upload using Ajax (PHP)
- Levyo Ajax Gallery supports Firefox 2.0.1 only?? (IT Professionals' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child close column createrange() css cursor decimal dependent design disablefirebug dom download dropdown editor element embed engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword hint html htmlform ie8 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl listbox math media microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php player post problem progressbar regex runtime scroll search security select shopping size software sql text textarea unicode w3c web website window windowofwords windowsxp wysiwyg \n





