Hello friends, I have the following code to show the image when the page loads when POSTing through a select:
this is the image:
<img src="img/icons/loader_transp.gif" width="20px" id="searchingimageDiv" class="img_loading" style="display:none">
this code from the select post:
$(document).ready(function(){
$("#Div2").change(function(){
$.ajax({
url:"../../../controllers/mi.php",
type: "POST",
data:"V="+$("#Div2").val(),
success: function(opciones){
$("#div_view").html(opciones);
}
})
});
});
This is the code to display the image:
$(window).load(function(){
$('#Div2').on("change", function(){
$('#searchingimageDiv').toggle();
});
});
The problem comes after making the post, the image is shown, but it is not automatically hidden when the page is finished loading, what can I be doing wrong, any suggestions
Thanks.
Can it serve you like this?
Hello Alexander, if what you want to do is hide the image when loading the page, you should place this code in the same document ready $("#searchingimageDiv").hide():
If you need to do it in another way, tell us your problem in more detail so that we can help you.