比如:
urls=https://i.cnblogs.com/EditArticles.aspx?opt=1&haha=中国
请求的url
http://www.w3school.com.cn/jsref/jsref_encodeURIComponent.asp需要将urls整个传入后台,这时候可能会存在丢失部分urls参数
需要用到encodeURIComponent函数
window.href="http://www.w3school.com.cn/jsref/jsref_encodeURIComponent.asp&urls=" + encodeURIComponent(urls)