Answer the question
In order to leave comments, you need to log in
IOS design loaded from cache when user presses BACK?
Click on the button, search in the search form
Deactivate the button to avoid another request
// automatically disable submit buttons
$('form').submit(function () {
// ignore if has 'special' class
if ($(this).hasClass('can-submit-again')) {
return;
}
// find submit button
var btn = $(this).find('input[type="submit"], button[type!="button"]');
// set spinner
$(btn).css('min-width', $(btn).innerWidth());
$(btn).html('<i class="fa fa-spinner fa-pulse fa-fw" aria-hidden="true"></i>');
$(btn).attr('disabled', 'disabled');
});
// check if user used return button, reload page to update cache
let $pageIsDirty = $('#page_is_dirty');
function checkIfDirty(){
if ('1' === $pageIsDirty.val()) window.location.reload();
};
function markPageDirty() {
$pageIsDirty.val('1');
}
(checkIfDirty()); // второй раз ети методы уже не будут вызваны
markPageDirty();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question