2013-04-06 33 views
8

使用iframe時可以刪除引用者嗎? 這裏的情況:在iframe上隱藏引用者

我有一個頁面在http://www.mywebsite.com與在其中。就像這樣:

<html> 
<head>...</head> 
<body> 
    ... 
<a href="#loadiframe">SHow Website</a> 
    <iframe id="#loadiframe" src="http://www.iframetarget.tld"> 
    ... 
</body> 
</html> 

我想iframetarget.tld不包含引用/不能看到,如果mywebsite.com加載自己的網頁。

是可能的嗎?

注:IFRAME將加載使用jQuery燈箱/顏色框

+1

你想愚弄google.com? :) – 2013-04-06 03:00:31

+0

不,它用於加載外部網站而不會注意iframetarget所有者。 – Andy 2013-04-06 03:15:45

+0

這就是我的意思 – 2013-04-06 03:32:45

回答

2

使用iframe用JavaScript位置重定向作品:

<iframe style="display:none" src="javascript:parent.location.replace('http://www.whatismyreferer.com/'+(parent.location.hash||''))"> 

注意,在某些瀏覽器中使用HTTP的情況下,最後引薦會總是被髮送,這將是擁有iframe的域名。使用HTTPS(和一個有效的證書)可確保在所有測試的瀏覽器上都有一個隱藏的引用。

7
<iframe id="#loadiframe" src='javascript:window.location.replace("http://www.iframetarget.tld")'> 

它的工作原理。