I have a simple Google Apps Script web that reloads page. I want the page after reload stay inside the iFrame. When I was preparing question for SO I was getting strange error Uncaught TypeError: Cannot set property 'src' of null
when
var iFrame = document.getElementById('myIframe')
var iFrame2 = $("#myIframe")
var test = document.getElementById('test')
console.log(iFrame)
console.log(iFrame2)
console.log(test)
none of the above elements were found - myIframe nor test. The source of the page is
<iframe id="myIframe" src="https://script.google.com/macros/s/AKfycbyraOI6MBYVeZ9CJlo79lR-OtVxyfMcU962wRG3iO0seu5LwzQMws-1iSm7KuRCB9S6rA/exec" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:85%;width:100%;position:absolute;top:505x;left:0px;right:0px;bottom:0px;"></iframe>
<div id="test"></div>
You can check here http://www.automatt.cz/iframe-reload/ The console once you type passcode returns
So, the javascript is running and is inside the iFrame page.
Strange is that on my different free google account almost the same code works. Could someone help me and explain what is happening?