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);(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);
Also in JavaScript:
- what is @ atsign in first of file path nodejs
- react route multiple components
- no response on stdout hackerrank javascript
- js var part of var name
- href javascript void
- measure width in px chrome extension
- javascript substring
- javascript deconstruct object
- dexie update table element
- javascript includes method getting 'hi' and 'high' problem
- How do you select a particular option in a SELECT element in jQuery?
- jquery autocomplete database
- await inside map js
- jquery loop through json
- update formgroup value angular
- res object anatomy nodejs
- convert functoin with call back to promise
- json beautify
- javascript read json file
- jquery select input with empty value
- how to parse query string in node.js lambda
- duplicate images in webpage js
- jquery attr multiple attributes
- javascript check if value in array