Programming Quest is the ultimate destination for programmers seeking solutions to technical questions related to programming languages, software settings, and more. Our blog provides easy-to-understand tips and tricks that will help you take your programming skills to the next level. Discover the power of Programming Quest today!
Loading gif image for freeze page to process ajax request in jquery
The
method is use to show some animated image at time of processing the
ajax request with gif image. where we have to use beforeSend object in
ajax call for loading gif at time of request processing.
Your ajax function looks like
Your ajax function looks like
$.ajax({
url: uri,
cache: false,
beforeSend: function(){
// show gif image when request sent
},
complete: function(){
// hide gif image when response receives
},
success: function(html){
// final output hadleling
}
});
Html Code:
<div class="loading">
<img src="//image path" class="img-responsive" />
</div>
Styling CSS Code:
.loading {
visibility: hidden;
background-color: rgba(255,255,255,0.7);
position: absolute;
z-index: +100 !important;
width: 100%;
height:100%;
}
.loading img {
position: relative;
top:50%;
left:50%;
}
Jquery Code:
$.ajax({ type:'POST', beforeSend: function(){ $('.loading').css("visibility", "visible"); }, url:'/quantityPlus', data: { 'data1':p1, 'data2':p2, 'data3':p3}, success:function(data){ // data fetch and show on html page }, complete: function(){ $('.
').css("visibility", "hidden"); } }); }
loading
Check current date falls between two dates function in jquery
The function is to check date comes between start and end date which should be in "dd/mm/yyyy" format.
function dateCheck(dateFrom,dateTo,dateCheck) { var d1 = dateFrom.split("/"); var d2 = dateTo.split("/"); var c = dateCheck.split("/"); var from = new Date(d1[2], parseInt(d1[1])-1, d1[0]); // -1 because months are from 0 to 11 var to = new Date(d2[2], parseInt(d2[1])-1, d2[0]); var check = new Date(c[2], parseInt(c[1])-1, c[0]); if(check > from && check < to) { return true; } return false; }
Calling method
var availability = dateCheck(startTheoryDate,endTheoryDate,currentDate);
And finally it returns boolean value weather it is true or false.
Programming Related Solutions
Hello, friends if you have any programming languages topic related doubt you ask in the comment box and also you can comment on our youtube channel videos.
And Subscribe our youtube channel Programming Quest
Hit more like, share and subscribe on our channel programming quest
Cloud computing concept on blog
What is cloud computing?
Cloud computing is means accessing and carrying data but not in any physical devices like hard disk, pen drive etc. i.e you are accessing data by some user credentials login.
Example :
you are accessing your personal email on any email account like gmail, yahoo, outlook etc.where we can check all personal email by logging in their website account in that case you are not carrying all email data in your physical storage device.
And if you want to see in detail just go to this YouTube video link:
Subscribe to:
Posts (Atom)