zoukankan      html  css  js  c++  java
  • Uncaught TypeError: $.cookie is not a function at <anonymous>:1:3前端页面内调试台bug

    1.报错信息:

    原因在jquery.js中没有引入jquery.cookie.js,HTML代码:

     1 {% load static %}
     2 <!DOCTYPE html>
     3 <html lang="en">
     4 <head>
     5     <meta charset="UTF-8">
     6     <title>Login</title>
     7 </head>
     8 <body>
     9 <form action="{% url 'login' %}" method="post"><!--url指定提交数据地址,待校验数据的def-->
    10     {% csrf_token %}<!--通过csrf认证机制-->
    11     用户名:<input type="text" name="username">
    12     密 码:<input type="password" name="password">
    13     <input type="submit" value="提交">
    14 </form>
    15 <script src="{% static 'jquery-3.4.1.js' %}"></script>
    16 </body>
    17 </html>

    2.在jquery后引入juqery.cookie.js

     1 {% load static %}
     2 <!DOCTYPE html>
     3 <html lang="en">
     4 <head>
     5     <meta charset="UTF-8">
     6     <title>Login</title>
     7 </head>
     8 <body>
     9 <form action="{% url 'login' %}" method="post"><!--url指定提交数据地址,待校验数据的def-->
    10     {% csrf_token %}<!--通过csrf认证机制-->
    11     用户名:<input type="text" name="username">
    12     密 码:<input type="password" name="password">
    13     <input type="submit" value="提交">
    14 </form>
    15 <script src="{% static 'jquery-3.4.1.js' %}"></script>
    16 <script src="{% static 'jquery.cookie.js' %}"></script>
    17 
    18 </body>
    19 </html>
  • 相关阅读:
    Andrew Ng机器学习 二: Logistic Regression
    Andrew Ng机器学习 一: Linear Regression
    python爬有道翻译
    硬件学习之无刷电机理论1
    字符串优化处理
    缓冲&缓存&对象池概念的理解
    线程池的学习及使用
    线程同步&线程池
    数据类型转换&运算符
    集合中常用的数据结构
  • 原文地址:https://www.cnblogs.com/Zhao159461/p/10969880.html
Copyright © 2011-2022 走看看