Created
July 9, 2015 17:00
-
-
Save ameensol/551bb2fd1349f73a4dc5 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script> | |
// Initialize params | |
var width = document.documentElement.clientWidth | |
var height = document.documentElement.clientHeight | |
var url = document.location.href + '?' + 'width=' + width + '&height=' + height | |
// Send request | |
var req = new XMLHttpRequest(); | |
req.open("GET", url, true); | |
req.onload = renderPage | |
req.responseType = "text"; | |
req.send() | |
// Handle Response | |
function renderPage() { | |
document.open(); | |
document.write(this.responseText); | |
document.close() | |
} | |
</script> | |
</head> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment