-# 
+#
 createDocument  = require("./document")
 EventSource     = require("eventsource")
 History         = require("./history")

          return

        window._response = response
        # JSDOM fires load event on document but not on window
        windowLoaded = (event)->
          document.removeEventListener("load", windowLoaded)

    if error
      browser.emit("error", error)
    else
      browser.emit("loaded", document)

  method = (method || "GET").toUpperCase()
