javascript - bootstrap calendar datetimepicker doesn't load when clicked -


for reason doesn't seem work...

edit1: in html file (sorry forgot add divs first time around)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="http://cdn.rawgit.com/eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/src/js/bootstrap-datetimepicker.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> <link href="http://cdn.rawgit.com/eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css" rel="stylesheet"/> 
<div class="container">     <div class="row">         <div class='col-sm-6'>             <div class="form-group">                 <div class='input-group date' id='datetimepicker1'>                     <input type='text' class="form-control" />                     <span class="input-group-addon">                         <span class="glyphicon glyphicon-calendar"></span>                     </span>                 </div>             </div>         </div>     </div> </div> 

in .js file

$('#datetimepicker1').datetimepicker(); 

possible reasons/solutions:

  1. there no element id "datetimepicker1". solution: add one.
  2. depending on include .js file, may need call inside jquery's ready event. fix this:

    $(document).ready(function() { $('#datetimepicker1').datetimepicker(); });


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -