I’m new to jQuery and I’m trying to prepend some HTML. However, I keeping getting syntax error via DreamWeaver.
Here is my code:
<script type='text/javascript'>
$(document).ready(function(){
$(".contentpadded").prepend($unoslider);
var $unoslider = $('
<ul id="unoslider" class="unoslider">
<li><img src="templates/{$template}/img/cloud-hosting.jpg" alt="" /></li>
<li><img src="templates/{$template}/img/green-hosting.jpg" alt="" /></li>
<li><img src="templates/{$template}/img/trusted-partners.jpg" alt="" /></li>
</ul>
'),
});
</script>
I can’t figure out what’s wrong with it. Any suggestions?
You should concatenate the strings, also note that there is a redundant
,in your code.Note that you should first define the variable and then append it.