Skip to content

Instantly share code, notes, and snippets.

@ameensol
Created July 9, 2015 17:00
Show Gist options
  • Save ameensol/551bb2fd1349f73a4dc5 to your computer and use it in GitHub Desktop.
Save ameensol/551bb2fd1349f73a4dc5 to your computer and use it in GitHub Desktop.
<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