Skip to content

Instantly share code, notes, and snippets.

@willtonkin
Last active December 16, 2015 15:49
Show Gist options
  • Save willtonkin/5459071 to your computer and use it in GitHub Desktop.
Save willtonkin/5459071 to your computer and use it in GitHub Desktop.
Really simple iframe test for Facebook App pages (810px x 800px). Gives you a change to test you work before throwing it into Facebook.
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Facebook frame test</title>
</head>
<body>
<script>
function goTo() {
var input = get("box").value,
frame = get("frame");
if(input.match(/\bhttp(.)*/)) {
frame.src = input;
} else {
input = "http://" + input;
frame.src = input;
}
}
function get(id) {
return document.getElementById(id);
}
</script>
<input type="text" id="box" value="http://www.example.com" />
<button onClick="goTo();">go</button>
<iframe src="http://www.example.com" frameborder="0" id="frame" width="810" height="800"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment