             self.create(item.text, item, delay)
             self.last_id = item.id
           break
-        self.reconnect()
-      error: ->
+      complete: ->
         self.reconnect()
 
   reconnect: =>

class @Danmaku
  constructor: ->
    self = this
    self.tid = 0
    self.last_id = 0
    self.count = 0
    self.size = null


  connect: =>
    self = this
    DEBUG('Danmaku: Hooking')
    self.ajax = $.ajax
      url: "//#{self.server}/poll"
