I have been suffering for what time it is over a simple question When filling out the field, an AYAX request is automatically sent with a long upload. I want to launch a preloader at this time and try the following:
<script> $("#visiting_object").change(function(){ if($(this).val() == 248399) { alert("тест"); return true; } else { $("#datepicker10").blur(function() { $.ajax({ type: 'post', url: 'Testdirect.php', data: $('.passegAdd').serialize(), beforeSend: function() { $('#loading').show(); }, complete: function() { $('#loading').hide(); } success: function (result) { $('#request').html( result ); console.log(result); /* alert("У вас количество заявок больше 5"); document.getElementById("button34").style.display="none";*/ } }); return true; }); } }); </script> <div id="loading" name="loading" class="windows8"> <div class="wBall" id="wBall_1"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_2"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_3"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_4"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_5"> <div class="wInnerBall"></div> </div> </div> </div> What could be wrong here, even I don’t understand ((Please tell me
blurevent in thechangeevent. What time do you want to show the loader? When you change the value or when you lose focus? - Stepan Kasyanenkohtmlfor#datepicker10. - Stepan Kasyanenko