tags:

views:

156

answers:

2

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.

A: 

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

Is it a valid url ?

FrankBr
A: 

Solved:

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

Had to just trick to be a string..

matthewb
or image+''
mkoryak