0

I want to prepend a div dynamically to another div using jQuery append function, but am getting some error.Here is my code:

prepend_data ='<div class="media">
<a class="pull-left" href="#">
<img class="media-object img-circle" src="<?=base_url()?  >folder/holderjs/holder.js/64x64">
<div class="media-body">
<h4 class="media-heading">
<strong>'+item.name+'</strong><span class="text-green">good</span> mode
</h4>
<abbr title="title">Location:</abbr>some text<br>
<abbr title="Phone">Ph:</abbr>'+' '+item.phone+'</div>
</div>';

$('.container').prepend(prepend_data);

Am getting this error "Uncaught SyntaxError: Unexpected identifier "

Please help. Thanks

4

1 回答 1

0

删除所有换行符,因此所有 'div' 内容将在同一行

于 2013-08-25T14:34:34.490 回答