2012-09-06 57 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>