I’m following quide in http://api.jquery.com/jQuery.getJSON/ and everything is great except I’m puzzled about injection part.
It’s hard for me to understand what this exactly does:
$('<ul/>', {
'class': 'my-new-list',
html: items.join('')
}).appendTo('body');
Well appendTo() is clear. But how it makes html out of JS array and how to remove wrapping? Can this be translated to group of simple commands?
That could be rewritten like so:
It’s just creating a new element with the specified values and properties.
From this link, it is the
jQuery( html,props )overload.