Jquery find difference between two arrays — September 27, 2018

Jquery find difference between two arrays

var array_one = [1,2,3,4];
var array_two = [3,4,5,6]

var difference = $(array_one).not(array_two).get();

console.log(difference);
// [1,2,5,6]

all credit goes to solidfoundationwebdev

Advertisements
jquery form validation checkbox error placement — August 9, 2018

jquery form validation checkbox error placement

By default library adds error after checkbox and it looks weird. solution is errorPlacement for checkbox

errorPlacement: function (error, element) {
   if (element.attr("type") == "checkbox") {
        error.insertBefore($(element).closest("p"));
    }
}

for better explanation read this article.

jQuery Datatable column inline edit — April 25, 2018
Ajax request returns 400 bad request — February 13, 2018
jQuery datatable add input to toolbar section — December 17, 2017
jquery Datatable table.columns is not a function —
jQuery remove empty element from an array — December 4, 2017