Created
November 1, 2011 20:43
-
-
Save ungoldman/1331840 to your computer and use it in GitHub Desktop.
Chrome "Display forbidden by X-Frame-Options" link fix
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
// Stuck in an iframe? Link throwing an error in Chrome? | |
// This jQuery snippet will make sure that every link and submit | |
// without a specified target will open at the window.top.location level. | |
jQuery(function($){ | |
$(document).on('click', 'a, :submit', function() { | |
var t = $(this)[0].target; if (t === '') t = '_top'; | |
}); | |
}); |
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
<!DOCTYPE HTML> | |
<html lang='en-US'> | |
<head> | |
<meta charset='UTF-8'> | |
<title></title> | |
</head> | |
<body> | |
<a href="http://youtu.be/zDZFcDGpL4U">link</a> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> | |
<script src="script.js"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment