Problem with maiking a string like I want it. :)

Sorry for the lousy summary.

this code:
thumbContent = thumbContent + ‘<a href="javascript:viewPic(’+ contact[i].ThumbnailUrl + ‘, ’ + contact[i].Name + ‘, ’ + contact[i].Description+ ‘)" ><img src="’+contact[i].ThumbnailUrl+’" border=“0” width=“134” height=“78” /></a>’;
outputs this:

<a href=“javascript:viewTruck(http://server.com/deliveredImage/Thumbnail/476, Aerts Jan, Aerts Jan)”><img src=“http://server.com/delivered/Image/Thumbnail/476” border=“0” width=“134” height=“78”></a>

But I want this for the javascript request to work:
<a href=“javascript:viewTruck(“http://server.com/deliveredImage/Thumbnail/476”, “Aerts Jan”, “Aerts Jan”)”><img src=“http://server.com/delivered/Image/Thumbnail/476” border=“0” width=“134” height=“78”></a>

Send the data as strings.
Can Anyone help me, brains not working.

Thank you.

Hah yes, mixing quotes can be painful. You’ll probably want to use double quotes in the function call so you’ll have to escape the single quotes around the attributes.

e.g.

thumbContent = thumbContent + '<a href=\\'javascript:viewPic("'+ contact[i].ThumbnailUrl + '", "' + contact[i].Name + '", "' + contact[i].Description+ '")\\' ><img src="'+contact[i].ThumbnailUrl+'" border="0" width="134" height="78"    /></a>';

Thank you very much, and sorry for my late reply.