formatting for concatenated string jquery
Hi I'm trying to get this
$( "<div class=\"images\ style=\"background:url('" + item.link + "')no-repeat top center;\"/>").appendTo("#images").wrap("<a target=\"_blank\ href='" + item.link + "'></a>");
to output correctly but I'm not very hot on concatenating javascript strings. It's the line 开发者_如何学运维background div I can't get right.
cheers
Andy
Try
$( "<div class='images' style='background:url(" + item.link + ")no-repeat top center;'/>").appendTo("#images").wrap("<a target='_blank' href=" + item.link + "></a>");
精彩评论