I have a success callback for a model fetch, and everything works fine on chrome, but on firefox the event does not fire. The request gets completed though, according to the console.
Code Sample:
Parent Class Function:
DownloadUserPromotions: (callback) ->
self = @
@model = new app.models.client({ id: JSON.parse($.cookie('jsondata')).id })
lm = ->
console.log "4"
window.USER = self.model
if typeof callback == 'function' then callback.call()
@model.fetch
success: lm
data:
relationships: 'client_promotions'
console.log "3"
View Function:
render: ->
self = @
self.ReadUserInfo()
console.log "1"
renderTemplate = ->
console.log "5"
#Below Issue is wierd.......#TODO
@USER = JSON.parse(JSON.stringify(@USER))
$(self.el).html clientsPromotionsTemplate
promos: USER.client_promotions
$('.spinner#load').hide()
self.FadeIn()
$('.spinner#load').show()
console.log "2"
@DownloadUserPromotions renderTemplate
@
Side Note: The marked TODO is a different issue. Bonus thank yous for helping me figure out why JSON works only in that convoluted manner.
Since my success callback was part of a JSON object, firefox couldn’t find whatever default it was looking for and therefore didn’t fire anything. Specifying dataType:’json’ when fetching solves this problem, because firefox knows where to look for the success call back.
Chrome is apparently reads my mind…