Last active
December 16, 2015 15:49
-
-
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.
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> | |
<!--[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