JavaScript   发布时间:2022-04-16  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Javascript 学习笔记 错误处理大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Java代码
复制代码 代码如下:

<html>
<head>
<title>javascript</title>
<script type="text/javascript">
function test(inVal){
try{
inVal=inVal.toUpperCase();
}catch(error){
alert("An exception has occurred.Error was:\n\n"+error.messagE);
}
}
</script>
</head>
<body>
<input type="button" value="Test" onclick="test(null);">
</body>
</html>

复制代码 代码如下:

<html>
<head>
<title>javascript</title>
<script type="text/javascript">
function test(inVal){
try{
inVal=inVal.toUpperCase();
}catch(error){
alert("An exception has occurred.Error was:\n\n"+error.messagE);
}
}
</script>
</head>
<body>
<input type="button" value="Test" onclick="test(null);">
</body>
</html>

利用firefox的firebug来调bug
引用
复制代码 代码如下:

<html>
<head>
<title>javascript</title>
<script type="text/javascript">
function test(){
var a=0;
console.log("checkpoint 1");
a=a+1;
console.log("checkpoint 2");
a=a-1;
console.log("checkpoint 3");
a=a.toLowerCase();
console.log("checkpoint 4");
}
</script>
</head>
<body>
<input type="button" value="Test" onclick="test(null);">
</body>
</html>

在IE中可以添加一个方法
引用
复制代码 代码如下:

function Console(){
this.log=function(intext){
alert(intext);
}
}
var console=new Console();

大佬总结

以上是大佬教程为你收集整理的Javascript 学习笔记 错误处理全部内容,希望文章能够帮你解决Javascript 学习笔记 错误处理所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:错误处理