I am trying to set a timeout on the following append method in jQuery. Everything I've tried keeps returning Uncaught SyntaxError: Unexpected identifier
Here is my code:
setTimeout("$('#user-comments').append('<div class='video_comment'>
<div class='name'>David</div><div class='time'>test</div>
<div class='indiv-comment'><p>'"+message+"'</p></div></div><hr class='gray' />')",3000);
Any help is appreciated.
setTimeout(function () {
$("#user-comments").append('<div class="video_comment">
<div class="name">David</div>
<div class="time"><?php echo date('F j, Y, g:i a'); ?></div>
<div class="indiv-comment"><p>' + message + '</p></div></div>');
}, 3000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With