UPDATE - The bounty is to help me resolve this issue and allow the code to filter back query results based on the user input. Full code can be shared if it helps via jfiddle
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)
);
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();
...
}