Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccjoe/url.js
parse and set url by url rules,根据url规则解析或设置url各部件
https://github.com/ccjoe/url.js
Last synced: 18 days ago
JSON representation
parse and set url by url rules,根据url规则解析或设置url各部件
- Host: GitHub
- URL: https://github.com/ccjoe/url.js
- Owner: ccjoe
- Created: 2015-11-27T07:15:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T10:55:58.000Z (about 9 years ago)
- Last Synced: 2024-11-20T18:53:50.296Z (3 months ago)
- Language: HTML
- Size: 217 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# url.js
parse and set url by url rules,根据url规则解析或设置url各部件
bower install url.js
## API ##
参见: (http://f2ee.com/jsdoc/url/url.html)[http://f2ee.com/jsdoc/url/url.html]在corajs项目中的测试代码的测试代码及结果:
## 测试代码 ##
```javascript
describe("Cora.url 测试获取url对象", function(){
var urlarr = ['http://www.test.com/a/b/c?test=1&kk=2#hash/p1/p2/p3?htest=1&hh=2',
'http://www.test.com/a/b/c/?test=1&kk=2#hash/p1/p2/p3',
'http://www.test.com/a/b/c?test=1&kk=2#hash?htest=1&hh=2',
'http://www.test.com/a/b/c/?test=1&kk=2#hash',
'http://www.test.com/a/b/c',
'http://www.test.com/#hash',
'https://test.cn/#hash',
'http://www.test.com/',
'http://test.com/',
'http://test.com/',
'/a/b/c#hash/p1/p2/p3/?test=1&kk=2',
'#hash/p1/p2/p3/?test=1&kk=2',
'#test?test=1&kk=2',
'?test=1&kk=2',
'#hash',
''];it("测试打印内容", function(){
for(var i=0 ; i