为什么是$ .datepicker();不起作用,但$ .hide();是什么?

时间:2012-08-09 15:37:23

标签: javascript jquery jquery-ui

我正在使用twitter bootstrap(通过less生成),jquery和jquery UI。以下是页面上的主要导入和脚本标记:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <link rel="stylesheet/less" href="/assets/less/bootstrap.less">
    <script src="/assets/less/less-1.3.0.min.js"></script>
    <link rel="shortcut icon" type="image/png" href="/assets/images/favicon.png">
    <link type="text/css" href="/assets/stylesheets/jquery-ui-1.8.22.css" rel="stylesheet" />
    <link rel="stylesheet" href="/assets/stylesheets/my.css" />

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  </head>

  <body>
   <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <!-- remember <link> tag for the jqueryUI css-->
    <script src="/assets/javascripts/jquery-1.7.2.min.js"></script>
    <script src="/assets/javascripts/jquery-ui-1.8.22.min.js"></script>
    <script src="/assets/javascripts/bootstrap-transition.js"></script>
    <script src="/assets/javascripts/bootstrap-alert.js"></script>
    <script src="/assets/javascripts/bootstrap-modal.js"></script>
    <script src="/assets/javascripts/bootstrap-dropdown.js"></script>
    <script src="/assets/javascripts/bootstrap-scrollspy.js"></script>
    <script src="/assets/javascripts/bootstrap-tab.js"></script>
    <script src="/assets/javascripts/bootstrap-tooltip.js"></script>
    <script src="/assets/javascripts/bootstrap-popover.js"></script>
    <script src="/assets/javascripts/bootstrap-button.js"></script>
    <script src="/assets/javascripts/bootstrap-collapse.js"></script>
    <script src="/assets/javascripts/bootstrap-carousel.js"></script>
    <script src="/assets/javascripts/bootstrap-typeahead.js"></script>

  <!--Jquery for the invite button datepicker-->
  <script type="text/javascript">
    $(document).ready(function() {
        $("div").hide();
        return false;
    });
    </script>


  </body>
</html>

注意最后一个标记,隐藏div的标记。此页面最终为空白,因为主div被隐藏(此处未显示)。如果,我用

替换它
<script type="text/javascript">
        $(document).ready(function() {
                $("#datepicker").datepicker();
            $("div").hide();
            return false;
        });
        </script>

然后没有任何反应 - div不会被隐藏。我尝试过使用Firebug,但是当我尝试检查脚本时它就开始挂起了。

我的导入是否有可能发生冲突?

0 个答案:

没有答案