Книга знаний

Инф. технологии

Страничка поиска в Google по определенному сайту

Очень часто требуется произвести поиск в Google по определенной странице (например, что-то найти на сайте Википедии, или на определенном форуме). Приведенный ниже образец HTML-кода показывает удобный способ сделать это.Автор статьи: romix
Последняя редакция №1 от 31.08.07
URL: http://kb.mista.ru/article.php?id=585

Скопируйте этот текст в файл HTML и дополните его по своему желанию.
Работающий пример - http://x-romix.narod.ru/wikigoogle.html


<html><head><meta http-equiv=content-type content="text/html; charset=windows-1251">
<title>Поиск в Google</title>
</head><body onLoad="xxx()">
<br><br>

<script type="text/javascript">
<!--
//Функция для установки фокуса на поле ввода (чтобы лишний раз не кликать мышкой).
function xxx()
{
  document.forms[0].q.focus();
}
//-->
</script>

<form name=gs method=GET action=http://www.google.ru/search>" target="_blank">http://www.google.ru/search>;

<input type=hidden name=hl value="ru">
<input type=hidden name=newwindow value=1>

<input id=w1 type=radio name=as_sitesearch value="ru.wikipedia.org" onFocus="xxx()"  checked>
<label for=w1>ru.wikipedia.org</label><br>

<input id=w2 type=radio name=as_sitesearch value="en.wikipedia.org" onFocus="xxx()">
<label for=w2>en.wikipedia.org</label><br>

<input id=w3 type=radio name=as_sitesearch value="kb.mista.ru" onFocus="xxx()">
<label for=w3>kb.mista.ru</label><br>

<input id=w4 type=radio name=as_sitesearch value="forum.mista.ru" onFocus="xxx()">
<label for=w4>forum.mista.ru</label><br>

<input id=w5 type=radio name=as_sitesearch value=""http://www.kuban.ru" target="_blank">www.kuban.ru" onFocus="xxx()">
<label for=w5>http://www.kuban.ru</label><br>" target="_blank">www.kuban.ru</label><br>;

<input id=w6 type=radio name=as_sitesearch value="itland.ru" onFocus="xxx()">
<label for=w6>itland.ru</label><br>

<input id=w7 type=radio name=as_sitesearch value="infostart.ru" onFocus="xxx()">
<label for=w7>infostart.ru</label><br>


<input id=all type=radio name=as_sitesearch value=""  onFocus="xxx()">
<label for=all>Везде</label><br>
<br>

<input type=text name=q size=41 maxlength=2048 value="" title="Поиск"> 
<input type=submit name="btnG" value="Поиск в Google">
</form>

</body>
</html>



То же самое но через выпадающий список:

<html><head><meta http-equiv=content-type content="text/html; charset=windows-1251">
<title>Поиск в Google</title>
</head><body bgcolor=#ffffff topmargin=3 marginheight=3>

<br><br>
<form name=gs method=GET action=http://www.google.ru/search>" target="_blank">http://www.google.ru/search>;

<input type=hidden name=hl value="ru">
<input type=hidden name=newwindow value=1>
<select name=as_sitesearch>
<option value="ru.wikipedia.org">ru.wikipedia.org
<option value="en.wikipedia.org">en.wikipedia.org
<option value="forum.mista.ru">forum.mista.ru
<option value="kb.mista.ru">kb.mista.ru
<option value="">Везде
</select>

<input type=text name=q size=41 maxlength=2048 value="" title="Поиск"> 
<input type=submit name="btnG" value="Поиск">
</form>


Описание | Рубрикатор | Поиск | ТелепатБот | Захваченные статьи | Установки | Форум
© Станислав Митичкин (Волшебник), 2005-2024 | Mista.ru

Яндекс.Метрика