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

html() is ignored #314

Open
OvalMedia opened this issue Dec 18, 2018 · 1 comment
Open

html() is ignored #314

OvalMedia opened this issue Dec 18, 2018 · 1 comment

Comments

@OvalMedia
Copy link

I am using jquery-2.1.4. (Although 1.11.1 yielded the same result).

<div id="clock"></div>

jQuery(document).ready(function ($) {
   $('#clock').countdown('2020/10/10', function(event) {
        $(this).html(event.strftime('%D days %H:%M:%S'));
        console.log(event.strftime('%D days %H:%M:%S'));
    });
});

The html() function is completely ignored while console.log() works fine, the time gets logged every second as expected.

No errors in the console or anything.

It gets even weirder. For the fun of it I put in an alert into the function:

jQuery(document).ready(function ($) {
   $('#clock').countdown('2020/10/10', function(event) {
        $(this).html(event.strftime('%D days %H:%M:%S'));
        alert(event.strftime('%D days %H:%M:%S'));
    });
});

It doesn't matter what the alert displays but with each alert window #clock actually gets displayed and updated all of a sudden. Of course this is not a solution but maybe it helps find the issue?

Might be related: #220

@OvalMedia
Copy link
Author

I got it working by using a completely different element as the target. The html() function should not modifiy the countdown() element.

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

No branches or pull requests

1 participant