<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript">
function Gourl(){
if (confirm("정말로 이동할까요"))
{
location.href="http://www.naver.com";
}
}
</script>
<style type="text/css">
input {border-color: black;background-color:white;}
</style>
</HEAD>
<BODY>
아래버튼을 눌러보세요.<p>
<form>
<input type="button" value="Go Naver" onClick="Gourl()">
</form>
</BODY>
========================================================================>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript">
function Gourl(site){
if (confirm("정말로 이동할까요"))
{
location.href=site;
}
}
</script>
<style type="text/css">
input {border-color: black;background-color:white;}
</style>
</HEAD>
<BODY>
아래버튼을 눌러보세요.<p>
<form>
<input type="button" value="Go Naver" onClick="Gourl('http://www.naver.com')">
<input type="button" value="Go Nate" onClick="Gourl('http://www.nate.com')">
<input type="button" value="Go Tistroy" onClick="Gourl('http://www.tistory.com')">
</form>
</BODY>
========================================================================>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript">
function Gourl(i){
if (confirm("정말로 이동할까요"))
{
switch (i)
{
case "i1":
location.href="http://www.naver.com";
break;
case "i2":
location.href="http://www.nate.com";
break;
case "i3":
location.href="http://www.tistory.com";
break;
default :
break;
}
}
}
</script>
<style type="text/css">
input {border-color: black;background-color:white;}
</style>
</HEAD>
<BODY>
아래버튼을 눌러보세요.<p>
<form>
<input type="button" value="Go Naver" onClick="Gourl('i1')">
<input type="button" value="Go Nate" onClick="Gourl('i2')">
<input type="button" value="Go Tistroy" onClick="Gourl('i3')">
</form>
</BODY>
========================================================================>
'º Learning 。 > ♂ Javascript ♀' 카테고리의 다른 글
[펌] javascript 필수... (0) | 2009.05.26 |
---|---|
document 객체의 전체 속성 확인하기 (0) | 2009.05.25 |
지역변수, 전역변수 확인 (0) | 2009.05.25 |
함수의 참조 (0) | 2009.05.25 |
리턴값이 있는 함수 (0) | 2009.05.25 |