     content && el.appendChild(content)
     el
 
-  onReady = ->
+  whenHasBody = ->
     # Add styles
     style_tag = mkEl 'style', null, document.createTextNode(style_code)
     document.getElementsByTagName('head')[0].appendChild style_tag

    # Wrapper for increased CSS specificity
    outerWrapperEl = mkEl 'div', 'factlink-containment-wrapper', jslib_jail_iframe

    document.body.appendChild outerWrapperEl

    load_time_before_jail = new Date().getTime()


        window.FACTLINK[methodCall.name](methodCall.arguments...)
      storedMethodCalls = undefined


  tryToInit = (i) -> ->
    if document.body
      whenHasBody()
    else
      console.log 'waiting #{i}...'
      setTimeout i, tryToInit(i+1)

  tryToInit(1)()

jslib_jail_code = __INLINE_JS_PLACEHOLDER__
style_code = __INLINE_CSS_PLACEHOLDER__
