thinkphp与jquery
页面代码为:
<form action="__URL__/login_in" method="post" name="form1"><br /> 邮箱<input type="text" name="email" id="email" class="inpt"><span class="emailmsg"></span><br/><br /> 密码<input type="password" name="pwd" id="pwd" class="inpt"><span class="pwdmsg"></span><br/><br /> <input type="button" value="" id="ulogin" class="log" ><br /> </form>
$("#ulogin").click(function(){<br /> $.ajax({<br /> url:"./index.php/User/logincheck",<br /> type:"POST",<br /> data:{email:$("#email").val(),pwd:$("#pwd").val()},<br /> //dataType:'text',<br /> //timeout:1000,<br /> error:function(){<br /> alert('请求错误');<br /> return false;<br /> },<br /> success:function(data){<br /> $('.emailmsg').html(data);<br /> //return false;<br /> }<br /> });<br /> });