这是一个用来获取URL中参数的jQuery插件。
语法:
querystring({[selector],[defaultvalue].[returndefaultifempty]})
note;[returndefaultifempty]-iftruereturnsdefaultvalueifnoquerystrings(intheURL)elsereturnsdefualtvaueofquerystringsifnoquerystrings
使用方法:
获取所有参数querystring({selector:[{id:"*"}]})
获取某个参数querystring({selector:[{id:"querystringname"}]})
ifyouwantallquerystringstoreturnthesamecertainvaluewhenyoucantfindthem({selector:[{id:""}]},deafaultvalue:"hello")
ifyouwantallquerystringstoreturnacertainindvidualvaluewhenyoucantfindthem({selector:[{id:"",deafaultvalue:"hello"},{id:"",deafaultvalue:"bye"}]})
thelasttwoexamplescanbeusedtogtherbutindvidualdefaultvalueswilloverridetheglobaloneoutsidetheselectorarray.
thinkyoucanwritethisdocumentationbettercontactme!
评论