How do I use javascript or jQuery to close an iframe within iframe itself? I've tried <a href="javascript:self.close()"> but it didn't work.
<a href="javascript:self.close()">
"Closing" the current iFrame is not possible but you can tell the parent to manipulate the dom and make it invisible.
In IFrame:
parent.closeIFrame();
In parent:
function closeIFrame(){ $('#youriframeid').remove(); }
1.4m articles
1.4m replys
5 comments
57.0k users