..
javascript try catch
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
<pre>
<html>
<body>
<script type="text/javascript">
var x=prompt("Enter a number between 0 and 10:","");
try
  {
  if(x>10)
    {
    throw "Err1";
    }
  else if(x<0)
    {
    throw "Err2";
    }
  else if(isNaN(x))
    {
    throw "Err3";
    }
  }
catch(er)
  {
  if(er=="Err1")
    {
    alert("Error! The value is too high");
    }
  if(er=="Err2")
    {
    alert("Error! The value is too low");
    }
  if(er=="Err3")
    {
    alert("Error! The value is not a number");
    }
  }
</script>
</body>
</html>

</pre>
http://www.w3schools.com/js/js_throw.asp

'DEV > html/css/js/img' 카테고리의 다른 글

IE6, IE7 버그 : overflow:auto position: relative  (0) 2010.08.25
z-index  (0) 2010.08.11
ipconfig  (0) 2010.08.06
  Comments,     Trackbacks