在我的模板,我包括jquery
和jquery.cookie.js
,但得到下面的錯誤:我jquery.cookie.js報告錯誤
下面是我的html代碼:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>cookie-login1</title>
</head>
<body>
<form action="/cookie/login1/" method="post">
<input type="text" name="username">
<input type="text" name="pwd">
<input type="submit" value="add">
<input id="btn" type="button" value="button-add">
</form>
</body>
<script src="/static/js/jquery.cookie.js"></script>
<script src="/static/js/jquery-2.1.4.min.js"></script>
<script>
$(function(){
$("#btn").click(function(){
$.ajax({
url:'/cookie/login1/',
type:"POST",
data:{'username':'root', 'pwd':'123'},
success:function(response){
}
})
})
})
</script>
</html>
我的jQuery版本是2.1.4
,我的jquery.cookie.js
版本是1.4.0
。
爲什麼?這是如何解決這個問題的?請解釋 –