Skip to content

Instantly share code, notes, and snippets.

@lewdev
Created May 28, 2020 22:22
Show Gist options
  • Save lewdev/12099d7722a5903dab54166d2bbff3e5 to your computer and use it in GitHub Desktop.
Save lewdev/12099d7722a5903dab54166d2bbff3e5 to your computer and use it in GitHub Desktop.
A minimal JavaScript/HTML page for testing out some JavaScript. I always get warnings for the charset not being there.
<!doctype html><html><head><meta charset="utf-8"><title>Template</title></head>
<body>
<div id="output"></div>
<script>
window.onload = function() {
var i
, row
, output = document.getElementById("output")
, size = data.list.length
, arr = []
;
for (i = 0; i < size; i++) {
row = data.list[i];
arr.push(row);
}
output.innerHTML = arr.join("");
};
var data = {
"list": "a,b,c,d,e,f".split(",")
};
</script>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment