JavaScript涓瓀indow.location.href鎬庝箞浣跨敤
window.location.href鏄竴涓敤浜庤幏鍙栨垨鑰呰缃綋鍓嶉〉闈㈢殑URL鐨勫睘鎬с€?/p>
鑾峰彇褰撳墠椤甸潰鐨刄RL锛?/p>
var currentURL = window.location.href;
console.log(currentURL);
鍦ㄥ綋鍓嶉〉闈㈣烦杞埌鍏朵粬椤甸潰锛?/p>
window.location.href = "http://www.example.com";
相关问答