I have written a JavaScript code were in I have calendar and a button the code is properly running outside joget. While in joget application if I click on the button the page reloads, how can I stop this reloads of the page and display my actual on click function in joget.
`$('#getBetween').click(function () {
var start = $("#date_picker1").datepicker("getDate"),
end = $("#date_picker2").datepicker("getDate"),
currentDate = new Date(start),
between = []
;
while (currentDate <= end) {
between.push(new Date(currentDate));
currentDate.setDate(currentDate.getDate() + 1);
}
$(document).ready(function () {
$("#results").html(between.map(function (value) {
return $('#results:last').after('<div class="block">' + value + '<button class="remove">x</button></div>')
}));
$('.remove').click(function () {
$(this).parent().remove();
console.log(between)
})
});
});
`
The getbetween is the function of my button. Ones I click on the button it displays the content at the same moment it refreshes the page, reloads the page in joget. While its properly working in Visual Studio. Can you please help me with this