$('#iframe').ready(function() {
$('#iframe a').attr('target', '_parent');
});
simple as that.
EDIT:
my html:
<div id='outerdiv'>
<iframe src="http://localhost:8888/harvest/blog" id='iframe' scrolling=no></iframe>
</div>
$('#iframe').ready(function() {
$('#iframe a').attr('target', '_parent');
});
simple as that.
EDIT:
my html:
<div id='outerdiv'>
<iframe src="http://localhost:8888/harvest/blog" id='iframe' scrolling=no></iframe>
</div>
Have you tried using a .load() event instead? See the below question.
To access iframes you need to use 'contents':
$('#iframe').ready(function() {
$('#iframe').contents().find('a').attr('target', '_parent');
});
Maybe because you could not modify the cross-domain iframe
document in JavaScript.