$("#logot_name").click(function(){
var current_user="pranav";
alert(current_user);//alert works
var Login = Parse.Object.extend("Login");
var query = new Parse.Query("Login");
query.equalTo("username",current_user);
query.descending("logintime");
query.first({
success: function(object) {
alert(123);//no alert
var d=$.now();
object.set("logouttime",d);
object.save();
},
error: function(object, error) {
alert('Failed to create new object, with error code: ' + error.message);//no error
}
});
alert(1234);//alert works
Parse.User.logOut();
$.session.set("Name"," ")
$.session.set("id"," ")
window.location.replace("index.html");
});
the above update object statement doesnt work. i have put it in document.ready,also the user logs out successfully.but the query doesnt execute also no error msg is displayed. somehow the query stmt is ignored.why?
Parse.initialize()with your account keys before running this script?