Krizia Simon Krizia Simon - 4 months ago 16
Javascript Question

javascript won't show in grails 3.1.9

Making the datepicker show via javascript but it doesn't work

<script>
$( "#invoiceDate" ).datepicker({
inline: true,
dateFormat: "yy-mm-dd",
onSelect: function(datetext){
datetext = datetext+" 00:00:00.0"
$('#invoiceDate').val(datetext);
}
});
<script>


The code works in grails 3.0.9 but not in 3.1.9
And no other javascript functions work as well
My JS files are all in assets/javascripts

Answer

in layouts main gsp, the javascript files must be defined via <asset:src>

Comments