国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

使用firebug進行調試javascript的示例

2019-11-20 21:27:10
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

<script type="text/javascript">
//用于在friefox中調試 用console.log("hello");
/** function test(name) {
console.log(name);
}
test("hello world");**/

//調試的技巧
function showLog(message) {
console.log(message);
console.info(message);
console.warn(message);
console.error(message);
console.debug(message);
}
function test(name) {
showLog(name);
}
test("hello");

</script>

調試示例
復制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">

function method() {
var result = 0;
for(var i = 0; i < 10; i++) {
result +=i;
}
document.getElementById("id1").innerHTML = result;
}


</script>
</head>
<body>
<input type="button" value="click" onclick="method()"/>
<div id="id1"></div>
</body>
</html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 昭平县| 龙门县| 自贡市| 饶平县| 兴安县| 杭锦后旗| 丰原市| 蓝田县| 汕头市| 丰台区| 卫辉市| 遂平县| 屯门区| 东宁县| 广汉市| 江西省| 甘孜县| 荣昌县| 谢通门县| 东台市| 宁陵县| 涪陵区| 历史| 京山县| 星座| 郴州市| 九江县| 麻江县| 平谷区| 睢宁县| 武胜县| 张家港市| 九龙城区| 交口县| 南安市| 惠州市| 威宁| 镇平县| 马关县| 尤溪县| 祥云县|