Skip to content

Instantly share code, notes, and snippets.

@andreimaxim
Created June 4, 2010 10:25
Show Gist options
  • Save andreimaxim/425259 to your computer and use it in GitHub Desktop.
Save andreimaxim/425259 to your computer and use it in GitHub Desktop.
(function () {
if (window.fluid) {
var NoTargets = {
FRAMES: [],
getFrames: function () {
var _timer = setInterval(function () {
if(/complete/.test(document.readyState)) {
clearInterval(_timer);
for(i = 0; i < window.frames.length; i++) {
NoTargets.FRAMES.push(i);
}
}
});
},
removeTargets: function (frameName) {
var frame = window.frames[frameName];
var _timer = setInterval(function () {
if(/complete/.test(frame.document.readyState)) {
clearInterval(_timer);
var links = frame.document.getElementsByTagName("a");
for(i = 0; i < links.length; i++)
links[i].removeAttribute("target");
}
});
},
init: function () {
this.getFrames();
for(i = 0; i < NoTarget.FRAMES.length; i++) {
this.removeTargets(i);
}
}
}
NoTargets.init();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment