묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
셀렉트 메뉴에서 새창띄우기 질문입니다 ㅠ
2006.02.28 15:32
아래소스가 셀렉트 메뉴에서 선택후 버튼을 누르면 해당페이지로 가는소스인데요..
새창으루 뜨게 하는방법줌 알려주세요 ㅠ
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
<body> </body> 안에 넣어줍니다.
<center>
<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.yoonmi.net">Yoonminet
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
<input type=button value="Go!" onClick="javascript:formHandler(this)">
</form>
새창으루 뜨게 하는방법줌 알려주세요 ㅠ
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
<body> </body> 안에 넣어줍니다.
<center>
<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.yoonmi.net">Yoonminet
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
<input type=button value="Go!" onClick="javascript:formHandler(this)">
</form>
window.location.href = URL;
을 다음과 같이 바꾸세요.
(단순한 새창으로 알아듣겠습니다;;)
window.open(URL,"_blank");