Skip to content

Instantly share code, notes, and snippets.

@neekey
Created September 4, 2012 02:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neekey/3616047 to your computer and use it in GitHub Desktop.
Save neekey/3616047 to your computer and use it in GitHub Desktop.
iframe - proxy
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>iframe - proxy</title>
</head>
<body>
<script>
(function() {
var getRequest = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"),
r = window.location.search.substr(1).match(reg);
return (r!=null)? unescape(r[2]) : null;
},
height = getRequest("data-frameheight");
try {
var el = window.top.document.getElementById(getRequest("data-frameid"));
if (!el) return;
el.style.height = height + 'px';
}
catch (e) {
}
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment