Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Why is Javascript object not updating fields?
- var imageType = "BoxArt";
- var uploadReason = "New season";
- var fileKey = "b2fc";
- alert("imageType = " + imageType);
- alert("uploadReason = " + uploadReason);
- alert("fileKey = " + fileKey);
- var iVO = { "images":{}};
- var thisImage = fileKey;
- iVO["images"][thisImage.fileKey] = thisImage;
- iVO["images"][thisImage.imageType] = imageType;
- iVO["images"][thisImage.uploadReason] = uploadReason;
- alert("iVO['images'][thisImage.imageType] = " + iVO["images"][thisImage.imageType]);
- alert("iVO['images'][thisImage.uploadReason] = " + iVO["images"] [thisImage.uploadReason]);
- alert("iVO['images'][thisImage.fileKey] = " + iVO["images"][thisImage.fileKey]);
- alert("JSON.stringify(iVO):n" + JSON.stringify(iVO));
- imageType = "BoxArt"
- uploadReason = "New season"
- fileKey = "b2fc"
- iVO['images'][thisImage.imageType] = "New season"
- iVO['images'][thisImage.uploadReason] = "New season"
- iVO['images'][thisImage.fileKey] = "New season"
- JSON.stringify(iVO):
- {"images"}:{"undefined":"New season"}}
- {
- "images":
- {
- "b2fc":
- {
- "imageType":"BoxArt",
- "uploadReason":"New season",
- "fileKey":"b2fc"
- }
- }
- }
- iVO["images"][thisImage.fileKey] = thisImage;
- iVO["images"][thisImage.imageType] = imageType;
- iVO["images"][thisImage.uploadReason] = uploadReason;
- iVO['images'][thisImage] = {
- "imageType":"BoxArt",
- "uploadReason":"New season",
- "fileKey":"b2fc"
- };
- iVO.images[thisImage] = {
- "imageType":"BoxArt",
- "uploadReason":"New season",
- "fileKey":"b2fc"
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement