I wish to pass an array to a function(can you tell me if im on the right track?)
and then in the function I wish to loop through the values in an array and append each one into the following LI element in HTML
This is what I have so far a user will code in the URL values he wants to pass:
var arrValues = ['http://imgur.com/gallery/L4CmrUt', 'http://imgur.com/gallery/VQEsGHz'];
calculate_image(arrValues);
function calculate_image(arrValues) {
// Loop over each value in the array.
var jList = $('.thumb').find('href');
$.each(arrValues, function(intIndex, objValue) {
// Create a new LI HTML element out of the
// current value (in the iteration) and then
// add this value to the list.
jList.append($(+ objValue +));
});
}
}
HTML
<li>
<a class="thumb" href="" title="Title #13"><img src="" alt="Title #13" /></a>
<div class="caption">
<div class="download">
<a href="">Download Original</a>
</div>
<div class="image-title">Title #13</div>
<div class="image-desc">Description</div>
</div>
</li>