JQuery won't work until I refresh the webpage

If the resources are included, a separate call like this will work (form onShow event probably):

plugins.WebClientUtils.executeClientSideJS('jQuery(function($){ $("#date").mask("99/99/9999",{placeholder:"dd/mm/yyyy"}); })')

If you wrap this in a function in the html:

'<html>\
    <head>\
      <script src="http://twitter.github.io/typeahead.js/js/jquery-1.10.2.min.js"></script>\
      <script type="text/javascript" src="http://digitalbush.com/wp-content/uploads/2014/10/jquery.maskedinput.js"></script>\
      <script type="text/javascript" src=\'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js\'></script>\
       <script>\
        function maskApply() {\
             jQuery(function($){\
               $("#date").mask("99/99/9999",{placeholder:"dd/mm/yyyy"});\
            });\
         }\
       </script>\
   </head>\
   <body>\
   <input id="date" tabindex="1" type="text">\
   </body>\
   </html>'

This this is how you trigger the client-side function:

plugins.WebClientUtils.executeClientSideJS('maskApply()')

You don’t need to include jquery as Servoy already has it. Just need the jquery UI and masked input resources.