1

I'm using Canjs on my app and when i call my function, the error callback is being called, but I'm getting a 200 response.

    var factory = new DTO(Factory);

    factory.save(
         function (data) {                                      
             self.element.html(can.view('viewDTO', {}));

         },
                function (error) {
                    console.log(error);
                }
        );

What am I doing wrong?

ramblinjan
  • 6,578
  • 3
  • 30
  • 38
Glund
  • 507
  • 1
  • 5
  • 20
  • 1
    Possibly: the returned response doesn't match the dataType specified (e.g. it expects a response that contains JSON but it isn't getting one); you're running up against the same origin policy when attempting to make a cross-domain AJAX request. What does the console say is wrong when you output `error`? – Anthony Grist Nov 18 '13 at 11:52
  • Object {readyState: 4, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…} abort: function ( statusText ) { always: function () { complete: function () { done: function () { overrideMimeType: function ( type ) { pipe: function ( /* fnDone, fnFail, fnProgress */ ) { progress: function () { promise: function ( obj ) { readyState: 4 responseText: "" setRequestHeader: function ( name, value ) { state: function () { status: 200 statusCode: function ( map ) { statusText: "OK" success: function () { – Glund Nov 18 '13 at 12:02

0 Answers0