Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery deparam

/**
 * jQuery.deparam - The oposite of jQuery param. Creates an object of query string parameters.
 * 
 * Credits for the idea and Regex:
 * http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
*/
(function($){
  $.deparam = $.deparam || function(uri){
    if(uri === undefined){
      uri = window.location.search;
    }
    var queryString = {};
    uri.replace(
      new RegExp(
        "([^?=&]+)(=([^&#]*))?", "g"),
        function($0, $1, $2, $3) { queryString[$1] = $3; }
      );
      return queryString;
    };
})(jQuery);
Comment

jquery deparam

(function ($) {
  $.deparam =
    $.deparam ||
    function (uri) {
      if (uri === undefined) {
        uri = window.location.pathname;
      }
      const url = window.location.pathname;
      const results = url.split("/");
      const result = results.pop();
      return result;
    };
})(Jquery);
Comment

PREVIOUS NEXT
Code Example
Javascript :: duplicate images in webpage js 
Javascript :: javascript this Inside Constructor Function 
Javascript :: React: readmore and read less 
Javascript :: javascript remove everything after . 
Javascript :: useQuery apollo more than one 
Javascript :: node js hello word 
Javascript :: React Javascript Builtin Hooks Import bug 
Javascript :: write buffer to file in node 
Javascript :: write a javascript code to display multiplication table in table 
Javascript :: return then javascript 
Javascript :: react native updating options with setoptions 
Javascript :: how to use hammerjs in ionic 5 
Javascript :: react catch error json message 
Javascript :: vue 3 props 
Javascript :: replaceAll vs replace vs split join 
Javascript :: leaflet js mobile popup not opening 
Javascript :: datepicker auto select off 
Javascript :: javascript find area of triangle 
Javascript :: vue js qr code scanner 
Javascript :: javascript not running 
Javascript :: check uncheck vanila js 
Javascript :: core.js:5592 WARNING: sanitizing unsafe URL value 
Javascript :: Ocultar un elemento cuando la ventana cambia de tamaño css 
Javascript :: Image preload React 
Javascript :: collision javascript 
Javascript :: shopify api for add to cart 
Javascript :: forward and reverse loop one by one js 
Javascript :: upload multiple image using jquery 
Javascript :: react native ios assessibility font size 
Javascript :: tilt js vue 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =