2012-09-06 30 views
0

我使用從瀏覽器書籤生成的iframe模式從用戶正在查看的網頁收集信息。iframe modal未能關閉

的代碼,用戶添加到其觸發點擊時的書籤的書籤工具欄是這樣的:

javascript:(function(d){var%20modal=document.createElement('iframe');modal.setAttribute('src','http://9ammusic.com/test/bookmarklet.html?url='+encodeURIComponent(window.location.href)+'&page_title='+document.title);modal.setAttribute('scrolling','no');modal.className='modal';document.body.appendChild(modal);var c=document.createElement('link');c.type='text/css';c.rel='stylesheet';c.href='//9ammusic.com/css/iframe.css';document.body.appendChild(c);}(document)); 

此代碼的方式來

95倍顯示問題出100這工作正常,它關閉,因爲它應該,但有時,關閉鏈接根本不工作 - 是否有不同的/更好的方式我可以關閉這種模式?

測試請訪問以下鏈接並嘗試書籤 - 它關閉罰款的Firefox,但不會關閉在Chrome:

http://www.ebay.co.uk/itm/JEFF-BANKS-BESPOKE-BLACK-RED-PINSTRIPE-100-WOOL-MENS-SUIT-36S-DRY-CLEANED-/330789478348?_trksid=p5197.m1992&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D14%26meid%3D1848697403629550114%26pid%3D100015%26prg%3D1006%26rk%3D1%26#ht_1830wt_1163 

回答

0

這適用於某種原因使所有的好現在,使用表單而不是鏈接:

<form method=post action=<?=$_GET['url']?> target="_parent"> 
<input type=submit value="X Close Window"></form>