2014-03-02 12 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頁面。

享受。

相關問題