Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to fix #61 #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siolag161
Copy link

As suggested by the title, this is a simple fix for #61 :

       <script type="text/javascript">
         document.addEventListener("DOMContentLoaded", function(event) {
           $("#%(id)s").datetimepicker(%(options)s);
          });
       </script>

Please note that it does not work in IE8 or older ( due to the lack of support for DOMContentLoaded). Look at here for a discussion on how to do onDocumentReady without Jquery loaded. (I'm not a fan of defer)

@rafaelverger
Copy link

@siolag161 why you did not use $(wrapper) instead of document.addEventListener('DOMContentLoaded') ?

<script type="text/javascript">
  $(function() {
    $("#%(id)s").datetimepicker(%(options)s);
  });
</script>

@rafaelverger
Copy link

BTW +1 for this 👏

@bardo
Copy link

bardo commented Nov 29, 2015

@rafaelverger He doesn't use jQuery because that's the whole issue of #61: if jQuery is loaded at the bottom of the page the code will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants