Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery get search parameter

$.urlParam = function (name) {
    var results = new RegExp('[?&]' + name + '=([^&#]*)')
                      .exec(window.location.search);

    return (results !== null) ? results[1] || 0 : false;
}

console.log($.urlParam('action')); //edit
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #search #parameter
ADD COMMENT
Topic
Name
4+1 =