0
我試圖讓我使用Parse的Javascript上傳的圖片的OBJECTID上傳的圖片的OBJECTID。 用下面的代碼上傳IM的successfuly像我解析的應用程序,而且我試圖打印出此上傳圖像的對象ID。得到解析
<!doctype html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
Parse.initialize("appid", "jskey");
function saveJobApp(objParseFile)
{
var jobApplication = new Parse.Object("magazia");
jobApplication.set("name", "Joe Smith");
jobApplication.set("image", objParseFile);
jobApplication.save(null,
{
success: function(gameScore) {
var photo = gameScore.get("image");
var name = gameScore.get("name");
var id = gameScore.get("objectId");
$("#profileImg")[0].src = photo.url();
$("#name")[0].innerHTML = name;
$("#objID")[0].innerHTML = id;
},
error: function(gameScore, error) {
alert('Failed to create new object, with error code: ' + error.description);
}
});
}
$('#profilePhotoFileUpload').bind("change", function(e) {
var fileUploadControl = $("#profilePhotoFileUpload")[0];
var file = fileUploadControl.files[0];
var name = file.name;
var parseFile = new Parse.File(name, file);
parseFile.save().then
(
function()
{
saveJobApp(parseFile);
},
function(error)
{
alert("error");
}
);
});
});
</script>
</head>
<body>
<input type="file" id="profilePhotoFileUpload">
<img id="profileImg"/>
<p id="name"></p>
<p id="objID"></p>
</body>
,所以我得到的圖像和名稱正確,但我不明白的OBJECTID和它說不確定。
有什麼想法?
這是打印出的圖像的OBJECTID!謝謝! –