https://github.com/xialeistudio/search
a jquery plugin operation window.location.search
https://github.com/xialeistudio/search
Last synced: 2 months ago
JSON representation
a jquery plugin operation window.location.search
- Host: GitHub
- URL: https://github.com/xialeistudio/search
- Owner: xialeistudio
- Created: 2014-08-02T07:31:25.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-02T08:29:16.000Z (almost 11 years ago)
- Last Synced: 2025-03-12T23:02:41.974Z (3 months ago)
- Language: JavaScript
- Size: 836 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery.search
======基于jquery开发的读取url查询参数的小插件,功能:
查询给定的url查询指定key的值
查询window.location.search查询指定key的值
查询window.location.search所有queryString的键值对数组
##开发环境##
本插件基于jquery 2.1.1 开发,其他版本jquery请自行测试##使用教程##
请确保每个key后面的值经过了 `encodeURIComponent()` 方法编码
示例url:http://www.example.com/?name=example&age=20
1.获取指定key的值
$.x_search('name'); //返回 example
2.获取所有
$.x_search();//返回[{name:"example"},{age:"20"}]
3.获取指定url的指定值
$.x_search('name','http://www.site.com/?name=exa');//返回 exa
##作者主页##
[JustThink](http://www.ddhigh.com/ "JustThink")