<script type="text/javascript">
layui.use(['layer'], function(){
$ = layui.juqery;
layer = layui.layer;
# });
function dologin(){
var username = $('#username').val();
var pwd = $('#pwd').val();
var verifycode = $( '#verifycode').val();
if (username == '') {
layer.alert('請輸入使用者名稱',{icon:2});
return;
}
if (pwd == '') {
layer.alert('請輸入密碼',{icon:2} );
return;
}
if (verifycode == '') {
layer.alert('請輸入驗證碼',{ icon:2});
return;
}
}
< ;/script>
錯誤:Uncaught TypeError: $ is not a function
靠已經解決、單字寫錯
jquery沒引入吧