Rumah >hujung hadapan web >tutorial js >js获取当前地址 JS获取当前URL的示例代码_javascript技巧

js获取当前地址 JS获取当前URL的示例代码_javascript技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBasal
2016-05-16 16:58:151107semak imbas
复制代码 代码如下:



thisDLoc = document.location;

thisURL = document.URL;

thisHREF = document.location.href;

thisSLoc = self.location.href;


thisTLoc = top.location.href;

thisPLoc = parent.document.location;

thisTHost = top.location.hostname;

thisHost = location.hostname;


Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn