Closed rnjailamba closed 9 years ago
Are you using any other Javascript libraries? Can you reproduce it in a JSFiddle?
Havent been able to reproduce the issue,the other libraries are the following:
My application.js file includes the following:
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap
//= require jquery.turbolinks
//= require turbolinks
//= require moment
//= require bootstrap-datetimepicker
//= require masonry/jquery.masonry
//= require_tree .
And below are all my script tags:
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en-US"></script>
Using (document).on('ready page:load', function () { $('#datetimepicker1').datetimepicker(); });
rather than
$(function () { $('#datetimepicker1').datetimepicker(); });
fixes the issue.You can close this now.Thanks
Ok great, glad you were able to figure it out. :)
I was using :
$(function () {
$('#datetimepicker1').datetimepicker();
});
and was getting the error
The error was solved by using:
var j = jQuery.noConflict();
j(document).ready(function(){
j('#datetimepicker1').datetimepicker();
})
Is there any reason for this?