javascript - query.first object always be undefined -


i have table name country,i key in country name find 1 correspond,but logs shows {object,object} , keep render message
"failed". please give me advice.

  var redeemnum = req.body.redeemnum;   var country = parse.object.extend("country");     var query = new parse.query(country);    query.equalto("name", redeemnum);   query.first({      success: function(object) {        if (typeof object === 'undefined') {            res.render("wrong", { msg : "failed!" } );        }         else {              res.render("wrong", { msg : "got it!" } );            }        }   }) 

i know may old ran , checked if object returned == null .. code here might like..

  var redeemnum = req.body.redeemnum;   var country = parse.object.extend("country");     var query = new parse.query(country);    query.equalto("name", redeemnum);   query.first({      success: function(object) {        if (object == null) {            res.render("wrong", { msg : "failed!" } );        } else {              res.render("wrong", { msg : "got it!" } );        }      }   }) 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -