검색결과 리스트
javascript에 해당되는 글 1건
- 2008.02.24 [javascript]브라우저 닫을때 경고
글
<html>
<head>
<script type="text/javascript">
window.onbeforeunload = beforeUnload;
function beforeUnload(){
return "Are you sure you want to leave?";
}
</script>
</head>
<body>
Please stay on this page!
</body>
</html>
-----------------------------------------------------------
좀 줄여서 쓰고 싶으면
window.onbeforeunload = function()
{
return "Are you sure you want to leave?";
}
이렇게 써도 되요.
보통은 이렇게 쓰지만..
window.onbeforeunload = function() {
return "Are you sure you want to leave?";
}
<head>
<script type="text/javascript">
window.onbeforeunload = beforeUnload;
function beforeUnload(){
return "Are you sure you want to leave?";
}
</script>
</head>
<body>
Please stay on this page!
</body>
</html>
-----------------------------------------------------------
좀 줄여서 쓰고 싶으면
window.onbeforeunload = function()
{
return "Are you sure you want to leave?";
}
이렇게 써도 되요.
보통은 이렇게 쓰지만..
window.onbeforeunload = function() {
return "Are you sure you want to leave?";
}
RECENT COMMENT