Strange issue when using easyXDM with Backbone js

114 views
Skip to first unread message

trivektor

unread,
Apr 2, 2012, 1:45:33 AM4/2/12
to easyxdm
Hi,

I have a Backbone JS model called listing_info (listing_info =
Backbone.Model). I set up my socket provider such that when it
receives a specific message from the consumer, it's going to persist
listing_info thru an ajax call.

Here's my provider socket

var socket = new easyXDM.Socket({
remote: "/blank.html", //without this I got an error "X is
undefined"
onMessage: function(message, origin) {
console.log(listing_info.attributes)
}
})

The strange thing happens in onMessage. Even though I have written new
attribute values to listing_info (and I can verify that the attributes
have been updated properly), when I do console.log, listing_info still
retains the old , original attribute values.

I wonder if anyone has experienced this issue?
Reply all
Reply to author
Forward
0 new messages