Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : [SOLVED] How to use findAll() error param? Or how to show login form when login session is expired and user action calls can.Model.findAll()?

$
0
0
  1. .fail( function( xhr ) {
  2.   var obj;
  3.   try {
  4.     obj = can.parseJSON( xhr.responseText );
  5.   } catch ( err ) {
  6.     obj = {};
  7.   }
  8. })
  9.  
That should do it, I think?

(If this is not a one-off, then you'll want to use some kind of base model that uses makeFindAll and its kin to set this up in a generic fashion. Have a look at the Caching data in local storage recipe to see how you should leverage these.)

Viewing all articles
Browse latest Browse all 3491

Trending Articles