Javascript createElement() — March 26, 2018

Javascript createElement()

var bookform = document.createElement("form");
bookform.setAttribute('onSubmit', "return validateForm(this)");
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 —
javascript Get query string parameters — December 11, 2017

javascript Get query string parameters

Now there is super easy way to do this.

// Assuming "?post=1234&action=edit"
    var urlParams = new URLSearchParams(;
    console.log(urlParams.has('post')); // true or false
    console.log(urlParams.get('post')); // get the value of key (post)
    //if u have more than one query parameters with same key
    console.log(urlParams.getAll('action')); // ["edit"]
    console.log(urlParams.toString()); // "?post=1234&action=edit"
    urlParams.append('active', '1'); //append new key and value to query string

for more help read this article

javascript get current page Url with or without query string — December 5, 2017
jQuery remove empty element from an array — December 4, 2017