I have been confronted with this strange behavior for some time now and cannot find a workaround.
There is a button with specific methods caused by a click. Firefox works well. In Chrome, it just refreshes the whole page.
$("#modoComparativa").click(function(){
if($(this).hasClass("active")){
$('#histFromDate').attr("placeholder","Date 1");
$('#histToDate').attr("disabled","disabled").attr("placeholder","Date 2");
startDatepickerComp();
}
else{
$('#histFromDate').attr("placeholder","Initial date");
$('#histToDate').attr("disabled","disabled").attr("placeholder","Final date");
startDatepicker();
}
$('#clearDates').attr("disabled","disabled");
requestGraph(idDetail, idArea, "", "");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Run codeIf I comment on everything except the selector and the click method call, the behavior will be the same. It refreshes everything.
I cannot figure out how to debug this, since every time I click the button, the whole page is refreshed and there are no errors / errors left in the browser debugger.
Any ideas would be appreciated.
Edit - add a selector as requested:
<div class="form-group"><button class="tooltip3 btn btn-default glyphicon glyphicon-random" id="modoComparativa" data-toggle="tooltip" title="ACTIVAR COMPARATIVAS" data-placement="bottom"></button>
</div>
source
share