try..catch在JS中的应用

<script type="text/javascript">
		try{
			alert("test try catch");
			alert(afdfds);
		}catch(exception)
		{
			var sError = "";
			for(var i in exception)
				sError += i + ":" + exception[i] +"\n";
			alert(sError);
		}
</script>

你可能感兴趣的:(JavaScript)