js cannot be loaded
A天罡星
A天罡星 2019-06-13 13:00:24
0
5
2082

I imported all the layui files. The CSS works, but the jS file cannot be loaded. What's going on? I checked the paths and they are exactly the same as yours.

A天罡星
A天罡星

reply all(5)
L

{username:$('#username').val(),pwd:$('#pwd').val(),verifycode:$('#verifycode').val()}

No, no, it should be like this, but also remove the single quotes

L

{'username':$('#username').val(),'pwd':$('#pwd').val(),'verifycode':$('#verifycode').val( )}

Try this, it should work


步履不停

The reference path seems to have no problem, but the type specified by your source code is wrong: type="text/javescript", you can check to see if this is the reason

A天罡星

我的本地路径D:\PHPTutorial\WWW\qiyu\public\static\plugins\layui

代码如下

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 

<title>登录</title>

<link type="text/css" href="__STATIC__/plugins/layui/css/layui.css" rel="stylesheet"/>

<script type="text/javescript" src="__STATIC__/plugins/layui/layui.js"></script>

</head>

<body style="background:#0ed8da">

 <div style="position: absolute;left:50%;top:50%;width:500px;margin-left:-250px;margin-top:-200px">

   <div style="background:#fdfdfd;padding: 20px;border-radius:4px;box-shadow: 5px 5px 20px #444444">

     <div class="layui-form">

  <div class="layui-form-item" style="color:grey">

    <h1>后胎管理系统<h1>

  </div>

  <hr>

  <div class="layui-form-item">

   <label class="layui-form-label">用户名</label>

 <div class="layui-input-block">

  <input type="text" id='username' class="layui-input">

 </div>

  </div>

  

  <div class="layui-form-item">

   <label class="layui-form-label">密码</label>

<div class="layui-input-block">

  <input type="password" id='password' class="layui-input">

</div> 

  </div>

  

  <div class="layui-form-item">

   <label class="layui-form-label">验证码</label>

<div class="layui-input-inline">

  <input type="text" id='verifycode' class="layui-input">

</div> 

<img id="code" src="{:captcha_src()}" onclick="this.src=this.src+'?'+Math.random()"/>

  </div>

<div class="layui-form-item">

<div class="layui-input-block">

<button class="layui-btn" onclick="dologin()">Login</button>

</div>

</div>

</div>

</div>

</div>

<script type="text/javascript">

layui.use(['layer'],function(){

$=layui.juqery;

layer=layui.layer;

});

function dologin(){

var username=$.trim($('#username').val());

var pwd= $.trim($('#password').val());

var verifycode=$.trim($('#verifycode').val());

if (username==''){

layer.alert('Please enter username',{icon:2});

return;

}

if(pwd==''){

layer.alert('Please enter password',{icon:2});

return;

}

if(verifycode==''){

layer.alert('Please enter the verification code',{icon:2});

return;

}

$.post('/admin.php/admin/Account/dologin',{'username':username,'pwd':pwd,'verifycode':verifycode},function(res ){

if(res.code>0){

layer.alert(res.msg,{icon:2});

}else{

layer.msg(res.msg);

setTimeout(function(){window.location.href='/admin.php/admin/Home/index'},1000);

}

},'json');

}

</script>

</body>

</html>


步履不停

You can post the code and file path to see

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template