How to check JQuery datatable version

$(document).ready(function(){
    $('#myTable').DataTable();

    var versionNo = $.fn.dataTable.version;
    alert(versionNo);
});
Source: https://stackoverflow.com/questions/31933241/how-to-check-the-datatable-version-i-am-using

Advertisements

Asc/Desc tooltip on sorting columns?

 

$(‘th’).each(function(){
if (($(this).hasClass(‘sorting’)) || ($(this).hasClass(‘sorting_desc’))) {
$(this).attr({title: ‘Sort Ascending’});
} else {
$(this).attr({title: ‘Sort Descending’});
}
});

 

Source: https://datatables.net/forums/discussion/718/asc-desc-tooltip-on-sorting-columns

 

Button type “button” vs. “submit”

type
The type of the button. Possible values are:

  • submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value.
  • reset: The button resets all the controls to their initial values.
  • button: The button has no default behavior. It can have client-side scripts associated with the element’s events, which are triggered when the events occur.

 

https://stackoverflow.com/questions/7117639/input-type-submit-vs-button-tag-are-they-interchangeable

https://stackoverflow.com/questions/37736056/button-type-button-vs-submit

https://stackoverflow.com/questions/290215/difference-between-input-type-button-and-input-type-submit

 

 

jquery detect textbox value change NOT based on user input

http://javascript.qahowto.com/jquery-detect-textbox-value-change-NOT-based-on-user-input-javascript-jquery-f4dfd4

https://stackoverflow.com/questions/16048084/jquery-detect-textbox-value-change-not-based-on-user-input

var $myText = $(“#myText”); $myText.data(“value”, $myText.val()); setInterval(function() { var data = $myText.data(“value”), val = $myText.val(); if (data !== val) { $myText.data(“value”, val); alert(“changed”); } }, 100);