How do you safely encode a URL using JavaScript such that it can be put into a GET string?
(如何使用JavaScript安全地编码URL,以便可以将其放入GET字符串中?)
var myUrl = "http://example.com/index.html?param=1&anotherParam=2";
var myOtherUrl = "http://example.com/index.html?url=" + myUrl;
I assume that you need to encode the myUrl
variable on that second line?
(我假设您需要在第二行编码myUrl
变量?)
ask by nickf translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…