Monday, 18 June 2018

Detect Safari Browser Using jQuery

<script>
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)  {
alert('Now, You are using safari browser...');  
}else{
alert('Now, You are not using safari browser...');
}
</script>


Saturday, 16 June 2018

How to Disable Date on Month Change in Datepicker Using jQuery?

I have created disable dates on change month in jQuery UI Datepicker. The Datepicker shows the disable date in Datepicker.

While click on Next or Prev month one Ajax page call for get disable date list.

In this demo, I have set a random date to disable. But you can set disable dates list in JSON format as per your requirement.

This demo will take little time for disabling date in Datepicker. Because of every change month in call callAJAX only for this month.



Download this Scrip Code of Disable Datepicker Click Here

Saturday, 9 June 2018

How to temporarily disable a button click in jQuery?

<script>
$("#button_id").click(function() {
  if($(this).data('dont')==1) return;
  $(this).data('dont',1);

  // Do Process .....

  $(this).data('dont',0);
}

///////// OR /////////

$("#button_id").click(function() {
  if($("#button_id").data('dont')==1) return;
  $("#button_id").data('dont',1);

  // Do Process .....

  $("#button_id").data('dont',0);
}
// Note: Remeber that $.data() would work only for items with ID.
</script>

Wednesday, 25 April 2018

How to get Last Month's record data from MySQL Database?



SELECT * from product_order WHERE YEAR(order_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) and MONTH(order_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)



Tuesday, 24 April 2018

How to get This Month's record data from MySQL Database?


SELECT * from product_order WHERE MONTH(order_date) = MONTH(NOW()) and YEAR(order_date) = YEAR(NOW())