The most common code causing this problem (KB927917) is appending to the body element from a script that is not a direct child to the body element. To put it another way , writing to the body element from grandchild nodes throws this error.
No Error
<body>
<script type="text/javascript">
document.body.appendChild(document.createElement('div'))
</script>
</body>
Operation Aborted
<body>
<div>
<script type="text/javascript">
document.body.appendChild(document.createElement('div'))
</script>
</div>
</body>
Solution
Create an element that you can write to that is closed.
<body>
<div><!-- add content to me instead of appending to the body --></div>
<div>
<script type="text/javascript">
document.getElementsByTagName('div')[0].appendChild(document.createElement('div'))
</script>
</div>
</div>
You can programmatically create that div as well.