首页 > 其他 > 详细

UParams

时间:2021-07-13 23:01:00      阅读:17      评论:0      收藏:0      [点我收藏+]

Parse URL parameters whatever hash or queryString.

Usage

var params = new UParams(‘http://xxx/xxx?a=1&b=2#c=3&d=4‘);
// The same to
// var params = new UParams({ a: 1, b: 2, c: 3, d: 4 });

// NOTE: Always string
params.a === ‘1‘;
params.b === ‘2‘;
params.c === ‘3‘;
params.d === ‘4‘;

// Convert to a QueryString
params.toString() === ‘a=1&b=2&c=3&d=4‘;
 

You can load UParams with UMD

require([‘UParams‘], UParams => {
  // DO SOMETHING
});

Run Testing Case

cd tests
bower install
cd ..
python -m SimpleHTTPServer &
open http://127.0.0.1:8000/tests

UParams

原文:https://www.cnblogs.com/sexintercourse/p/15008667.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!