-2
我得到https://github.com/carhartl/jquery-cookie cookie.js当我打电话
$(document).ready(function(){
\t $("#abc").click(function() {
\t \t var a = $("#text").val();
\t \t var b = $("#password").val();
\t \t alert("asdasdsd ");
\t \t $.cookie("user",a);
\t \t alert($.cookie("user"));
\t \t
\t });
\t
});
<form>
\t user: <input id="text"> </input>
\t pass: <input id="password" type="password"></input>
\t <button id="abc">submit</button>
</form>
它没有为我工作。 在我的实验室中,我导入了Jquery,cookie.js。 谢谢!
http://jsfiddle.net/arunpjohny/yvd7p7x4/1/ - 看起来很好 –
检查控制台的错误 – Tushar
它在这个链接工作,但在我的实验室它是undefined –