This does not work:
$block.insertAfter(form);
$('.date', $block).datetime({
userLang: 'en',
americanMode: true
});
but it does:
$block.insertAfter(form);
window.setTimeout(function() {
$('.date', $block).datetime({
userLang: 'en',
americanMode: true
});
}, 1000);
datetime()is a plugin that I attach to an input element with a class date. Obviously, # 1 does not work, because this element is still not available in the DOM, waiting for 1 second of work. But it's hacked. How can I extend jQuery to accept a callback for a method insertAfter()or in some other way?
TK123 source
share