I am trying to use this plugin: https://github.com/tombonner/jurlp .
I want to make url using parameter. Can we make using this plugin?
Here is my code
// first case
var a = 'http://abc/deappsl/index.html?word=abc';
var abc = {
test:"lo"
}
// second case
var a = 'http://abc/deappsl/index.html';
var abc = {
test:"lo",
p:'er'
}
// expected output
//first
//http://abc/deappsl/index.html?word=abc&test=lo
//second
//http://abc/deappsl/index.html?test=lo&p=er
http://plnkr.co/edit/IEnUPyGAgCCCPeII0xh3?p=preview
I have two cases
Can we use this plugin to make url?
Any update ?
You can parse the original URL using $.jurlp
var url = $.jurlp(a);
Then you can update the query parameters with the .query()
method.
url.query(abc);
Then see the new URL
console.log(url.href);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.