I'm trying to insert the html content in a few iFrames and I got a strange javascript error when I'm adding a tag. The code I want to insert looks like (on the real example there is some code) :
<head>
<script>/*This line is causing the problem */</script>
</head>
<body>
<h1 style='text-align: center;'>This IS an iframe</h1>
</body>
the js errror is : Uncaught TypeError: Cannot read property 'appendChild' of null (you need to be in development mode). If you remove the line the error will not longer exist.
The simplified source code example: https://codepen.io/anon/pen/MdoLpq
I'm a bit lost here, any ideas or hints are welcomed.