2014-03-02 44 views

回答

0

使用:

var _URL = encodeURIComponent("anotherhost.com?somevar=var&anothervar=var2"); 
//result: anotherhost.com%3Fsomevar%3Dvar%26anothervar%3Dvar2 

编码的URL,使用它作为一个url PARAM。

不是打电话与新网址:

location.href = "mywebsite.com?urlparam="+ _URL; 
//result:"mywebsite.com?urlparam=anotherhost.com%3Fsomevar%3Dvar%26anothervar%3Dvar2" 

这个重新装入新的URL页面。

享受。

相关问题