Created
October 11, 2018 06:36
-
-
Save VorticonCmdr/632de5c3a3ff382ed4b0b2aa7678f7d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<html lang="en" prefix="og: http://ogp.me/ns#"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Google Fetch and Render test</title> | |
</head> | |
<body> | |
<span>useragent</span> | |
<p id="uaOutput"></p> | |
<span>random number</span> | |
<p id="randomNumber"></p> | |
<span>fetch result</span> | |
<p id="fetchType"></p> | |
<script> | |
var randomNumber = document.getElementById('randomNumber'); | |
randomNumber.textContent = Math.random(); | |
var uaOutput = document.getElementById('uaOutput'); | |
uaOutput.textContent = navigator.userAgent; | |
var fetchType = document.getElementById('fetchType'); | |
fetch('/abc.txt').then(function(response) { | |
response.text().then(function (text) { | |
fetchType.textContent = text; | |
}); | |
}).catch(function(err) { | |
fetchType.textContent = err; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment