Error: Cannot call method 'createDocumentFragment' of null

Error: Cannot call method 'createDocumentFragment' of null

During page load I'm trying to add an element to the DOM.

The code:
  1. $(document).ready(function () { $(document).prepend("<div id=new_div style=z-index:1;></div>"); }); 
I've tested this on FF21, Chrome27 and IE10. They all return the error mentioned in the title.

Debugging on jquery-1.10.0.js, I tracked down the problem to line 5998 where
  1. safeFrag = document.createDocumentFragment()
Apparently document is null. Going up the stack trace to domManip on line 6249 the object is passed as this [ 0 ]. ownerDocument, which is null.

I've stripped the javascript on the page to just loading jQuery and running this command, and the issue persists.

See this jsFiddle, the alert doesn't pop, meaning the javascript engine got stuck on the line before.

Help appreciated.