Parse & JS: Retrieving the 3 special values using objectid

This entry is part 11 of 25 in the series Parse & Javascript

As for the 3 special values created by Parse, we can also retrieve them as well using

  • movieObject.id
  • movieObject.updatedAt
  • movieObject.createdAt
<!doctype html>
<head>
    <title>My Parse App</title>
    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
    <script type='text/javascript' src='http://www.parsecdn.com/js/parse-1.2.17.min.js'></script>
</head>

<body>

<div>
    <div style='display:none' class='error'>
        <h1>objectid not found</h1>
    </div>

    <div style='display:none' class='success'>
        <h1>Successfully found the objectid</h1>
    </div>
</div>

<script>
    Parse.initialize('5d3sro43zBGj8AMYqWND5bFYMzAan7f5P5euZm7M', 'hlRZZqAylA7Fmah4Kk6ma8WK7QCT4cHrxjafnnkI');
    var MovieObject = Parse.Object.extend('MovieObject');
    var movieObject = new MovieObject();

    var query = new Parse.Query(MovieObject);
    query.get('KpM9EZvArG', {
        success: function (movieObject) {
            $('.success').show();
            alert(movieObject.updatedAt);
        },
        error: function (movieObject, error) {
            $('.error').show();
        }
    });

</script>

</body>
</html>
Try The Code
Series Navigation<< Parse & JS: Retrieving object using objectid
Parse & JS: Retrieving refreshed object >>