کد جستجو گر Yahoo - Google - MSN برای وبلاگ .
نمونه کد :
کد در ادامه مطلب ...
<form name="jksearch" action="http://www.google.com/search" method="get" onsubmit="jksitesearch(this)">
<p>Search shomaha.com:<br />
<input type="hidden" id="hiddenquery" name="q" />
<input type="text" name="qfront" style="width: 200px;" value="متن مورد جستجو" /> <input type="submit" value="Search" /><br />
</p><div style="font-family: Verdana; font-style: normal; font-variant: normal; font-weight: bold; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;">Google:<input type="radio" name="se" checked="true" /> Yahoo:<input type="radio" name="se" /> MSN:<input type="radio" name="se" />
</div>
<script type="text/javascript">/*<![CDATA[*/
// 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>
<p></p>
</form>
<p style="font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; text-align: left;"><br />
</p>