jQuery QuerystringjQuery URL参数插件

联合创作 · 2023-10-02 15:09

这是一个用来获取URL中参数的jQuery插件。

语法:

querystring({[selector], [defaultvalue].[returndefaultifempty]})

note; [returndefaultifempty] - if true returns defaultvalue if no querystrings (in the URL) else returns defualt vaue of querystrings if no querystrings

使用方法:

获取所有参数 querystring ({selector:[{id:"*"}]})

获取某个参数 querystring({selector:[{id:"querystring name"}]})

if you want all query strings to return the same certain value when you cant find them({selector:[{id:""}]}, deafaultvalue:"hello")

if you want all query strings to return a certain indvidual value when you cant find them({selector:[{id:"", deafaultvalue:"hello"}, {id:"", deafaultvalue:"bye"}]})

the last two examples can be used togther but indvidual defaultvalues will override the global one outside the selector array.

think you can write this documentation better contact me!

浏览 14
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报