Last active
August 31, 2016 19:11
-
-
Save bcarno/e32b4a2f3579c9b66b4f18b3364ecb35 to your computer and use it in GitHub Desktop.
Checks to see if window is in an iframe and if it is it changes all links to open in the current window, regardless of what their previous target was. Requires jQuery to work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isInIframe = (self !== top) ? true : false; | |
$(function(){ | |
if(isInIframe){ | |
$('a').attr("target", "_self"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment