What I have is when a user enters a name into a textbox and clicks a button, the value in the textbox is saved to the Parse database.
What iI'm trying to do is get the name that was added and add it to a div.
On this Live Example, it's basically what I want, except it alerts [object Object] and not thomas in this case.
You need to use the specific part of the result you need. In your case, replace
query.first({
success: function (results) {
alert("Successfully retrieved " + results + " ");
divTag.innerHTML = results.toString();
},
error: function (error) {
alert("Error: " + error.code + " " + error.message);
}
});
with
query.first({
success: function (results) {
alert("Successfully retrieved " + results.attributes.FirstName + " ");
divTag.innerHTML = results.attributes.FirstName.toString();
},
error: function (error) {
alert("Error: " + error.code + " " + error.message);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With