小弟今天看到一段javascript 的code
但一直不太懂它的意思
google也找不到相關的所以只好上來請教各位
程式如下
with(document.form2)
{
}
就是這個迴圈,我發現某種情況下它不會跑,請問它是代表什麼功用呢?
詳細說明在這:
http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/with
簡單範例如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form name="f1">
<input type="text" name="tt" />
<input type="button" onclick="xx()" value="會出錯" />
<input type="button" onclick="zz()" value="正確" />
</form>
</body>
</html>
內文搜尋

X