Monday, February 13, 2017

innerHTML test

<div id="atnbg20170213m1938" style="position:absolute;left:0px;top:0px;width:400px;height:200px;color:pink"></div>
<div id="atnbg20170213m1940frame" style="position:absolute;left:0px;top:200px;width:400px;height:200px;background-color:lightgoldenrodyellow"><div id="atnbg20170213m1942iframe" style="position:absolute;left:0%;top:0%;width:20%;height:20%;background-color:orange"></div></div>

<script>

function atnbg20170213m1938() {
var readout = document.getElementById("atnbg20170213m1938")
var iframe = document.getElementById("atnbg20170213m1942iframe")
var frame = document.getElementById("atnbg20170213m1942frame")
function escape(string) {
var array = string.split("<")
var newstring = ""
for (var i = 0; i < array.length; i = i + 1) {
newstring = newstring + array[i]
if (i < array.length - 1) {newstring = newstring + "&lt;"}}
var array = newstring.split(">")
newstring = ""
for (var i = 0; i < array.length; i = i + 1) {
newstring = newstring + array[i]
if (i< array.length - 1) {newstring = newstring + "&gt;"}}
return newstring}

readout.innerHTML = escape(frame.innerHTML)
iframe.style.width = "50%"; iframe.style.height = "50%"
readout.innerHTML = readout.innerHTML + escape(frame.innerHTML)}

atnbg20170213m1938()

</script>