사이트 내 전체검색
검색엔진을 선택하여 검색하는 소스
https://cmd.kr/javascript/282 URL이 복사되었습니다.

본문

<script language="JavaScript">
<!--
function startSearch() {
searchString = document.searchForm.searchText.value;
if(searchString != "") {
searchEngine = document.searchForm.whichEngine.selectedIndex;
finalSearchString = "";

// 각 검색엔진의 검색 경로들
if(searchEngine == 1) { // 야후 코리아
finalSearchString = "http://kr.softwise.yahoo.com/bin/query?p="+searchString;
} else
if(searchEngine == 2) { // 야후 US
finalSearchString = "http://search.yahoo.com/bin/search?p="+searchString;
} else
if(searchEngine == 3) { // 라이코스 코리아(=네이트)
finalSearchString = "http://webpage.nate.com/srch_webresult.asp?query="+searchString;
} else
if(searchEngine == 4) { // 라이코스 US
finalSearchString = "http://search.lycos.com/default.asp?lpv=1&loc=searchhp&tab=web&query="+searchString;
} else
if(searchEngine == 5) { // 네이버
finalSearchString = "http://search.naver.com/search.naver?where=nexearch&query="+searchString+"&x=31&y=13";
} else
if(searchEngine == 6) { // 드림위즈
finalSearchString = "http://search.dreamwiz.com/cgi-bin/irs.cgi?so=2&q="+searchString+"&x=31&y=13";
} else
if(searchEngine == 7) { // 다음
finalSearchString = "http://search.daum.net/cgi-bin/search?u=host&doc=host&fmt=c&qt=&q="+searchString+"&x=25&y=16";
} else
if(searchEngine == 8) { // 한미르
finalSearchString = "http://dsearch.hanmir.com/search/asearch.php?TG=9&QR="+searchString;
} else
if(searchEngine == 9) { // MSN 코리아
finalSearchString = "http://search.msn.co.kr/results.asp?cp=949&PI=9571&DI=29&FORM=MSNH&q="+searchString;
} else
if(searchEngine == 10) { // 심마니
finalSearchString = "http://search.chol.com/cgi-bin/tsearch.cgi?w=99&q="+searchString+"&x=15&y=6";
} else
if(searchEngine == 11) { // 구글 코리아
finalSearchString = "http://www.google.co.kr/search?q="+searchString+"&ie=UTF-8&oe=UTF-8&hl=ko&lr=lang_ko";
} else
if(searchEngine == 12) { // 알타비스타 코리아
finalSearchString = "http://www.altavista.co.kr/search/webcategory.php3?stype=webcategory&pg=q&q="+searchString+"&stq=0&nbq=5&enc=euckr&kl=";
} else { // 지정된 경로가 없을시 경고창
alert('지정된 경로가 없습니다.');
document.searchForm.searchText.focus();
return false;
}
location.href = finalSearchString;
}
}
//-->
</script>

<title>검색엔진을 선택하여 검색하는 소스</title>
<B>검색어를 입력하고 검색엔진을 선택하세요.</B><br>
<form name="searchForm">
<B>검색어</B>
<input name="searchText" type="text">
<B>검색엔진</B>
<select name="whichEngine" onchange="startSearch()">
<option selected>Select / Reset
<option>Yahoo Korea
<option>Yahoo US
<option>Lycos Korea(=Nate)
<option>Lycos US
<option>Naver
<option>Dreamwiz
<option>Daum
<option>Hanmir
<option>MSN Korea
<option>Simmani
<option>Google Korea
<option>Altavista Korea
</select>
</form>

출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=94

댓글목록

등록된 댓글이 없습니다.

831 (10/17P)

Search

Copyright © Cmd 명령어 18.222.163.134