我将datepicker用于jquery-ui时出现错误

时间:2019-03-24 21:25:17

标签: javascript jquery jquery-ui datepicker twig

我为jQuery UI添加了日期选择器,但出现了此错误:

  

未捕获的TypeError:$(...)。datepicker不是函数

我添加了插件jQuery和jQuery-ui,但是我也有错误

细枝:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>{% block title %}Acceuil-{% 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>

我添加了插件jquery和jquery UI,但是我有此错误..如何解决此错误

0 个答案:

没有答案