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>
  • 相关阅读:
    Spring的两种代理JDK和CGLIB的区别浅谈
    抽象 工厂模式
    Mybatis总结面试题
    java抽象工厂模式
    java工厂设计模式
    java单例设计模式
    lombok基本使用
    HTML
    select查询操作(重要)五
    mysql的DML语言(需要背下来)(四)
  • 原文地址:https://www.cnblogs.com/Zhao159461/p/10969880.html
Copyright © 2011-2022 走看看