0
    $("#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?

2
  • Have you added the reference to the Parse library JS file, and called Parse.initialize() with your account keys before running this script? Commented Mar 17, 2015 at 15:29
  • yeah other queryies on same page are working Commented Mar 17, 2015 at 16:06

1 Answer 1

1

You need to remove quote to refer to your var:

Replace

var query = new Parse.Query("Login");

By

var query = new Parse.Query(Login);
Sign up to request clarification or add additional context in comments.

1 Comment

Needs to be var Login = Parse.Object.extend("Login"); var query = new Parse.Query(Login);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.