0
我不得不处理在多个网址,应在URL查询参数传递的情况下,例如:通过URL查询中多个URL PARAMS
http://example.com/?landing=<url1>&referrer=<url2>
url1: http://test1.com/test.html?param=x¶m2=y
url2: http://test2.com/test/test.html?p=x&c=&...
目前我正在努力没有成功如下:
var l = encodeURIComponent(document.URL);
var r = encodeURIComponent(document.referrer);
window.location.href = 'http://example.net/?landing=' + l + '&ref=' + r;
我的问题是:什么 将编码URL1和URL2的最佳方式?我应该使用encodeURIComponent还是使用base64编码来处理那些参数或者其他的东西?