使用URI获取链接和参数

https://medialize.github.io/URI.js/docs.html#accessors-hostname 

这个是参考文档的地址

var uri = new URI("http://example.org/foo/hello.html?foo=bar&bar=baz"); // get search uri.search(); // returns string "?foo=bar&bar=baz" (leading ?) // get query uri.query(); // returns string "foo=bar&bar=baz" (no leading ?) // .query() and .search() behave the same for the following: // set search uri.search("?foo=bar&bar=baz"); // returns the URI instance for chaining uri.search("foo=bar&bar=baz"); // returns the URI instance for chaining // uri == "http://example.org/bar/world.html?foo=bar&bar=baz" // remove query uri.search(""); // returns the URI instance for chaining // uri == "http://example.org/bar/world.html" // get data map: uri.search(true); // returns { foo: "bar", hello : ["world", "mars"] } // set data map: uri.search({ foo: "bar", hello : ["world", "mars"] }); // uri == "http://example.org/bar/world.html?foo=bar&hello=world&hello=mars" // overwrite data through callback uri.search(function(data) { return { hello : "world" }; }); // uri == "http://example.org/bar/world.html?hello=world" // augment data through callback uri.search(function(data) { data.foo = "bar"; }); // uri == "http://example.org/bar/world.html?hello=world&foo=bar" // CAUTION: beware of arrays, the following are not quite the same // If you're dealing with PHP, you probably want the latter… uri.search("?foo=bar&bar=baz"); uri.search("?foo=bar[]&bar[]=baz");

转载于:https://www.cnblogs.com/kangjy/p/7522455.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
微信公众号redirect_uri参数是指在进行微信公众号二次开发时,用于进行微信授权的回调URL参数。当用户点击同意授权后,微信会将授权码或访问令牌等信息重定向到该URL。 如果在使用redirect_uri参数时出现错误,可以参考以下解决办法: 1. 参考文献中提供了一种解决redirect_uri参数错误的方法,可以查看该链接获取具体解决方案。 2. 参考文献也提供了关于解决微信OAuth2.0网页授权只能设置一个回调域名的问题的方法,你可以参考该链接获取更多信息。 3. 参考文献中提到了微信公众平台接口调试工具,你可以使用该工具来调试和检查你的redirect_uri参数是否正确。 总结来说,微信公众号redirect_uri参数是用于微信授权的回调URL参数,如果出现错误,可以参考上述提到的解决方法来解决。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [微信公众号 redirect_uri 参数错误](https://blog.csdn.net/weixin_43852196/article/details/116660538)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [微信公众号授权登录后报redirect_uri参数错误的问题](https://blog.csdn.net/sD7O95O/article/details/126092778)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值