简体   繁体   中英

datepicker not working when i add plugin jQuery and jQuery-ui

I have add datepicker for jQuery UI but I have this error:

Uncaught TypeError: $(...).datepicker is not a function

I add plugin jQuery and jQuery-ui but I have also error

code twig:

<!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8" />
            <title>{% block title %}Acceuil- Trouvez une nounou c'est facile{% endblock %}</title>
            {% block stylesheets %}
                <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Raleway:400,700|Merriweather:400,700" rel="stylesheet" type="text/css">
                <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
                <link href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" rel="stylesheet">
                <link rel="stylesheet"  href="{{ asset('bundles/app/css/MarkerCluster.css') }}">
                <link rel="stylesheet"  href="{{ asset('bundles/app/css/MarkerCluster.Default.css') }}">
                <link rel="stylesheet"  href="{{ asset('bundles/app/css/application-42e4eacdbf0506bba5a7d1c783732309c84eb2d6203203da608691b414ebe1c7.css') }}">
            {% endblock %}
            <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
        </head>
        <body>
            <div id="page">
                {% block header %}
                            <header id="navbar">
                                <div class="container">
                                <a class="logo nounou-top"  href="{{path('homePage')}}">BabySitter</a>

                                <div class="ui secondary user menu floated right">
                                <div id="connect_subscribe_links">

                                <a class="item" id="navbar_connect" href="{{path('fos_user_security_login')}}">Connexion</a>
                                <a class="ui small action button blue" id="navbar_subscribe" href="{{ path('inscription') }}">Inscription</a>
                                </div>
                                <div class="ui dropdown autolaunch icon button right top pointing blue" id="connect_subscribe_menu">
                                <i class="dropdown icon"></i>
                                <div class="ui menu transition hidden">
                                <a class="item" href="/sessions/new">Connexion</a>
                                <a class="item" href="/welcome/choice_category_ad">Inscription</a>
                                </div>
                                </div>
                                </div>
                                </div>
                            </header>
                {% endblock %} 
                {% block body %}            


                {% endblock %}
             </div> 
            {% block javascripts %}
                <script src="{{ asset('bundles/app/js/places.js') }}"></script>
                <script src="{{ asset('bundles/app/js/jquery.js') }}"></script>
                <script src="{{ asset('bundles/app/js/jquery-ui.min.js') }}"></script>
                <script src="{{ asset('bundles/app/js/application-5385288a7f4b3693dff01f301b0b54547c2887a2eaf0c85b91ed655ec7424ff7.js') }}"></script>
                <script src="{{ asset('bundles/app/js/stripe.js') }}"></script>
                <script>
     $( function() {
        $( "#datepicker" ).datepicker();
      } ); 
    </script>
            {% endblock %}
        </body>
    </html>

I add plugin jquery and jquery UI but I have this error .. how to resolve this error please

删除这个,再试一次:(你的问题是你两次调用jquery库)

<script src="{{ asset('bundles/app/js/jquery.js') }}"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM