0

Using Parse.com and JavaScript SDK

I've created a fiddle here http://jsfiddle.net/Dano007/jst34fe4/1/

The query runs and returns the current user object, as per the below screen shot part of that object is the url, which I want to display as an image. Currentlyno image is showing. I'm not sure why?

Please not the image is stored as a file in parse. I've read the parse document here, but that has'nt helped solve this. https://www.parse.com/docs/js_guide#files-retrieving

ProfilePic: {__type:File, name:tfss-fc2a6901-40a1-49d9-9044-3d4bcc42d7a1-danimage.jpg,…}
__type: "File"
name: "tfss-fc2a6901-40a1-49d9-9044-3d4bcc42d7a1-danimage.jpg"
**url: "http://files.parsetfss.com/0fc5cba8-caf7-4c81-aafc-36390888e497/tfss-fc2a6901-40a1-49d9-9044-3d4bcc42d7a1-danimage.jpg"**

enter image description here

Object structure

8
  • In the fiddle, the login does not work. Commented Oct 31, 2014 at 12:43
  • Can you give me detail? what bit is'nt working? Commented Oct 31, 2014 at 12:47
  • It throws 404, with this JSON response: {"code":101,"error":"invalid login parameters"} (Guess they haven't heard of 403 (: ) Commented Oct 31, 2014 at 12:49
  • tweaked it, try now? Commented Oct 31, 2014 at 12:51
  • then please update the Fiddle link, it changes after updates Commented Oct 31, 2014 at 12:53

1 Answer 1

2

You should get the URL as the following: object.get('ProfilePic').url(), because the url is a method, returning the _url field.

Also, you should delete <div id="Image01"></div>, as it casues an id collision. After these it works as expected.

Edit

I have updated the fiddle link.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.