簡體   English   中英

從iframe獲取網站的域名

[英]Fetching the domain name for a website from an iframe

我正在使用var url = (window.location != window.parent.location) ? document.referrer:document.location; var url = (window.location != window.parent.location) ? document.referrer:document.location; 從我的iframe中訪問網站的域名。 出乎意料的是,這項工作! 但是,這對所有情況都適用嗎?

parent.location適用於所有瀏覽器: http : //www.w3schools.com/jsref/prop_win_parent.asp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM