I'm trying to take one string and split it into different chunks, and place it inside divs. Here's my code:
var simple = '<?php echo $hallo; ?>';
var $div = $('#mybook');
if ($div.text().length > 50) {
var limit = simple.lenght = 10;
$(simple.split(limit)).each(function() {
$('#mybook').append('<div>'+this+'</div>')
});
}
Thank you, any help is appreciated.
String.splitdoesn't take a number, it takes a string delimiter that tells the function where to create the chunks.;. Some of your statements end with it, others don't.abcdefghijklmnopqrstuvwxyz. The result should be<div>ab</div><div>cd</div>and so on. At least that's what seems he's looking for..