分享一则javascript 调试技巧
作者:bea
不用alert,用console.log() 代码如下: <!DOCTYPE html> <html> <head> <script type="text/javascript"> function showLog(message){ console.log(message); } function test(name){ showLog(name); } test("hello
不用alert,用console.log()
代码如下:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function showLog(message){
console.log(message);
}
function test(name){
showLog(name);
}
test("hello");
</script>
</head>
<body>
</body>
</html>
以上算是一个个人心得,这里分享给大家,小伙伴们试试看。
有用 | 无用
代码如下:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function showLog(message){
console.log(message);
}
function test(name){
showLog(name);
}
test("hello");
</script>
</head>
<body>
</body>
</html>
以上算是一个个人心得,这里分享给大家,小伙伴们试试看。
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- jQuery中:button选择器用法实例
- 原生javascript实现隔行换色
- jQuery中:reset选择器用法实例
- 浅谈 javascript 事件处理
- jquery实现可拖拽弹出层特效
- jQuery中:image选择器用法实例
- jQuery中:submit选择器用法实例
- jQuery中:checkbox选择器用法实例
- jQuery中:radio选择器用法实例
- jQuery中:password选择器用法实例
- jQuery中:text选择器用法实例
- JS打开新窗口防止被浏览器阻止的方法
- jQuery中:input选择器用法实例
- jQuery中:only-child选择器用法实例
- js中取得变量绝对值的方法
- 基于豆瓣API+Angular开发的web App
- node爬取微博的数据的简单封装库nodeweibo使用指南
- AngularJS + Node.js + MongoDB开发的基于高德地图位置的通讯录
- javascript制作的cookie封装及使用指南