开发者

datepicker in jade template

开发者 https://www.devze.com 2023-04-08 15:07 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消