Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

October 01, 2022, 03:04:46 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 193513
  • Total Topics: 21092
  • Online today: 45
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 37
Total: 37

Author Topic: All In One Search Yahoo, Google, MSN  (Read 6076 times)

0 Members and 1 Guest are viewing this topic.

Offline Porky

  • Hero Member
  • *****
  • Posts: 608
  • B.A. DBA
    • Facebook!
All In One Search Yahoo, Google, MSN
« on: January 04, 2006, 10:16:26 PM »
Java/Html block

Code: [Select]
<form name="jksearch" action="http://www.google.com/search" method="get" onSubmit="jksitesearch(this)">

<p>Java Script:<br />
<input id="hiddenquery" type="hidden" name="q" />
<input name="qfront" type="text" style="width150" value="navigator object" /> <input type="submit" value="Search" /><br />
<div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked>  Yahoo:<input name="se" type="radio">  MSN:<input name="se" type="radio">
</div>

<script type="text/javascript">

// All-in-one Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use

//Enter domain of site to search.
var domainroot="www.javascriptkit.com"

var searchaction=[ //form action for the 3 search engines
"http://www.google.com/search",
"http://search.yahoo.com/search",
"http://search.msn.com/results.aspx"
]

var queryfieldname=["q","p","q"] //name of hidden query form for the 3 search engines

function switchaction(cur, index){
cur.form.action=searchaction[index]
document.getElementById("hiddenquery").name=queryfieldname[index]
}

function jksitesearch(curobj){
for (i=0; i< document.jksearch.se.length; i++){ //loop through radio to see which is checked
if (document.jksearch.se[i].checked==true)
switchaction(document.jksearch.se[i], i)
}
document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value
}


</script>


Courtiesy if www.javascriptkit.com