Register    Sign in
Authentification
uCoz Scripts » Others » –

Instant Google finder on your site

This script will be creating a text field, and a button. When the button is clicked, the search query from the text field will be appare in a new tab.
Create a new page with this HTML code:
Code
<script type="text/javascript">  
  function googlefind()  
  {  
  var ugras = document.getElementById('kveri').value;  
  if (ugras.length<1) {  
  alert('Hey! The search field is empty!');  
  }else {  
  var ugras2 = ugras.replace(" ","+");  
  window.open(url='http://www.google.com/search?q='+ugras2+'',target='_blank');  
  }  
  }  
  </script>  

  <div align="center"><img border="0" align="absmiddle" src="http://ucoztaska.into.hu/src/google.png" height="90" width="260" />  
  <input type="text" size="60" height="30" id="kveri" style="font-size:16pt; border:1px solid #000;" onkeydown="Javascript: if (event.keyCode==13) googlefind()" style="margin-bottom:6px;" />
   
  <input type="button" onclick="googlefind()" value="Search" />  
  </div>






Autor: bigblog  2017-08-21, 13:49:51   Views : 1209   

Tags:


Total comments (0)
avatar