I'm new to Jade and express and need to add datepicker from jquery UI to one of my layered popup.I have tried inline script and header javascript with onload without any luck.
script(src='/javascripts/jquery-1.4.4.js')
script(src='/javascripts/jquery-ui.js')
script(type='text/javascript')
function initDate() {
$('#mdate').datepicker({dateFormat: 'yyyy-mm-dd'});
}
input(type='text', name='mdate', id='mdate')
Any suggestions or help 开发者_运维知识库would be appreciated. Thanks
Try this code instead
script(src='/javascripts/jquery-1.4.4.js')
script(src='/javascripts/jquery-ui.js')
script(type='text/javascript')
$(function(){
function initDate() {
$('#mdate').datepicker({dateFormat: 'yyyy-mm-dd'});
}
});
input(type='text', name='mdate', id='mdate')
All I'm doing is telling the page to wait till it's ready before applying the datepicker
精彩评论