Your code states:
var query = new Parse.Query(myBadges);
new Parse
.Query("myBadges")
.matchesQuery("uploadedBy", new Parse.Query("_User")
.equalTo("username", friendName)
);
It does not assign the correct object to query
.
I believe it should be
var query = new Parse
.Query(myBadges)
.matchesQuery("uploadedBy",
new Parse.Query("_User")
.equalTo("username", friendName)
);
Update:
Other problems show up here, with the friendName
variable.
This is declared inside your friendFeed
function:
function friendFeed() {
var friendName = $('#friendsearch').val();
...
}
In this way, it is not accessible outside the function. Plus, you set a value here, but try to overwrite it on your event.
Prefer a parameter:
$(document).ready(function () {
$(document).on('click', '.username', function (event) {
event.preventDefault();
friendFeed($(this).text());
});
});
function friendFeed(friendName) {
//var friendName = $('#friendsearch').val();
...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…