1

Are you able to place a variable into attr of src?

Example:

$("#member-image2").attr({src : image});        

I am using facebook connect and the "image" is their variable and "member-image2" is my img ID ..

Is this even possible? Because as is, it is not doing it.

2 Answers 2

1

Solved:

$("#member-image2").attr({src : ''+image+''});

Had to just trick to be a string..

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

Comments

0

yes you can, but what does the image var say if you alert or log it ?

Is it a valid url ?

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.