SharePoint JavaScript Cross-Domain issue with Backbone.js RRS feed

  • Question

  • Has anyone run into problem building a SharePoint App using JavaScript and Backbone.js as a single page application? To be precise, SharePoint JavaScript OM works well within Backbone.js framework but when I change my App from SharePoint hosted to Provider hosted, I have to switch to JavaScript cross-domain library. Now the strange issue emerges.

    Any event registered with Backbone for routing will cause any JavaScript cross-domain call to SharePoint fail with timeout, with the same exact code. For example, my SPA loads the first time, hits the default route in Backbone.js, which directs to the proper Backbone.js view. The App route makes cross-domain call to load SharePoint list data and renders the data in the view. Suppose I have a navigation button or a simple button that fires up a hastag and intercepted by Backbone.js to switch to a different view, and the router will make the same cross-domain call to load SharePoint list data and render the data in the view. You would have guessed this just work but it does not. Any call to SharePoint times out with no other error code. It does not matter whether you use REST API or JavaScript OM with cross-domain library. However if you change App deployment option to SharePoint hosted so there is no need to use cross-domain library, this problem is gone.

    I am not sure where to debug this issue and I am totally puzzled. Please note if I am simply reload page on client, such as using windows.location = 'full url without #', instead of using hashtag to go through Backone.js routing, it will work.

    • Edited by devweb Thursday, October 25, 2012 6:30 PM
    Thursday, October 25, 2012 5:40 PM


All replies

  • Hello devweb,

    Do you have a sample project we could take a look at?  From your description it seems that something on backbone is colliding with our cross-domain library.


    Thursday, November 1, 2012 9:08 PM
  • Hello devweb, any additional details/info/sample on the issue you are facing?  Thanks
    Wednesday, November 14, 2012 10:49 PM
  • I'm marking this as answered but please unmark if you have more details of the issue you are facing.

    Program Manager, Office Developer Platform.

    Wednesday, November 21, 2012 10:09 PM