What does this code mean? (jquery) -


i reading plugin , can understand part

$('<ul />', {     'class': settings.ulclass,     html: albumitem.join('') }).appendto($this); 
  1. what html: albumitem.join(''). html keyword or user defined? can't search because word html return generic result

  2. is selection similar $('p').appendto($this) ? if can search grammar of this?

thanks

.join() native method of array objects, joins elements of array string.

assuming albumitem array, albumitem.join('') join elements in array create string joining character empty string.

ex:

var albumitem = ['one', 'two', 'three']; albumitem.join('') // give 'onetwothree' 

your code

$('<ul />', {             'class': settings.ulclass,             html: albumitem.join('')         }).appendto($this); 

will create ul element class returned settings.ulclass , have contents of array albumitem children , element appended element referenced $this

demo: fiddle


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -