Get started with jquery-deparam CDN
MIT licensed
JQuery DEparam: plugin converts query strings to objects/arrays.
Tags:- jquery
- deparam
- param
- querystring
Stable version
Copied!
How to start using jquery-deparam CDN
$(document).ready(function() {
// Example query string
const queryString = 'name=John&age=30&city=New+York&hobbies[]=reading&hobbies[]=swimming';
// Include the library using the provided CDN link
$.getScript('https://cdn.cdnhub.io/jquery-deparam/0.5.3/jquery-deparam.js', function() {
// Parse the query string using jquery-deparam
const params = $.deparam.querystring(queryString);
// Log the parsed object to the console
console.log(params);
// Access individual values
console.log(params.name); // John
console.log(params.age); // 30
console.log(params.city); // New York
console.log(params.hobbies); // ["reading", "swimming"]
});
});
Copied!
Copied!