為什么在Dreamweaver中使用JS來(lái)定義函數(shù)時(shí)會(huì)提示說(shuō)有語(yǔ)法錯(cuò)誤的?無(wú)法實(shí)現(xiàn)代碼。
<title>無(wú)標(biāo)題文檔</title>
<script type="text/javascrip>
function check(){
? ? var un = document.getElementById("text1");
? ? var pw1 = document.getElementById("password1");
? ? var pw2 = document.getElementById("password2");
? ? if(un.value == "" || pw1.value == "") {
? ? ? ? alert("用戶名或密碼不能為空");
? ? ? ? return false;
? ? }
? ? if( pw1.value!=pw2.value){
? ? alert("密碼與確認(rèn)密碼不一致");
? ? return false;
? ? }
}
</head>
2016-04-08
你在關(guān)閉head前加上</script>試試
2016-04-08
我發(fā)代碼給你看看吧:
<title>無(wú)標(biāo)題文檔</title>
<script type="text/javascrip>
function check(){
? ? var un = document.getElementById("text1");
? ? var pw1 = document.getElementById("password1");
? ? if(un.value == "" || pw1.value == "") {
? ? ? ? alert("用戶名或密碼不能為空");? ? var pw2 = document.getElementById("password2");
? ? ? ? return false;
? ? }
? ? if( pw1.value!=pw2.value){
? ? alert("密碼與確認(rèn)密碼不一致");
? ? return false;
? ? }
}
</head>
2016-04-07
截圖看看啊