Monday 14 July 2014

Sys.InvalidOperationException: The object is used in the context different from the one associated with the object

Solution:
Don't create sharepoint context number of times. Just do once, like this.

var objContext;
SP.SOD.executeFunc("sp.js", 'SP.ClientContext', function () {
objContext= new SP.ClientContext.get_current();
});