Parse.com 및 JavaScript SDK.
코드는 "imgs"ID에 표시되어야하는 결과를 쿼리하고 반환합니다. 순간 나는
포착되지 않은 TypeError : 정의되지 않은 'get'메소드를 호출 할 수 없습니다.
오류. 시도했지만 원인이나 해결 방법을 이해할 수 없습니다.
페이지 URL은 여기 http://kudosoo.com/friendslistTEST.html입니다.
나를 미치게 만드는 ...
var currentUser = Parse.User.current();
var FriendRequest = Parse.Object.extend("FriendRequest");
var query = new Parse.Query(FriendRequest);
query.include('toUser');
// query.include('fromUser');
//query.include('pic');
query.equalTo("fromUser", currentUser);
query.equalTo("status", "Request sent");
query.find({
success: function(results) {
// If the query is successful, store each image URL in an array of image URL's
imageURLs = [];
for (var i = 0; i < results.length; i++) {
var object = results[i];
imageURLs.push(object.get('pic'));
}
// If the imageURLs array has items in it, set the src of an IMG element to the first URL in the array
for(var j = 0; j < imageURLs.length; j++){
$('#imgs').append("<img src='" + imageURLs[j].get("toUser").pic + "'/>");
}
},
error: function(error) {
// If the query is unsuccessful, report any errors
alert("Error: " + error.code + " " + error.message);
}
});
// show the signup or login page
</script>
<div id="imgs"></div>
사용하여 해결되었습니다.
imageURLs = [];
for (var i = 0; i < results.length; i++) {
var object = results[i].get("toUser");
imageURLs.push(object.get("pic"));
}
// If the imageURLs array has items in it, set the src of an IMG element to the first URL in the array
console.log(imageURLs);
for(var j = 0; j < imageURLs.length; j++){
$('#imgs').append("<img src='" + imageURLs[j] + "'/>");
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다