Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- success: function(data){
- var items = [];
- items.push("<li class='group'>Product</li>");
- .each( data, function( key, val ) {
- console.log(key);
- var productImages = "<img class='product-thumb' src='" + val.id_default_image + "'>";
- var productHeading = "<p class='product-heading'>" + val.name + "</p>";
- var productShortDescription = "<span class='product-short-description'>" + val.short_description + "</span>";
- var productPrice = "<p class='product-price'>" + val.price + "</p>";
- /* id menggunakan val.name + val.id */
- items.push( "<li id='"+ val.name + val.id"' value='" + val.id + "'><a href='#product' >"+ productImages + productHeading + productShortDescription + productPrice + " </a></li>" );
- /* val.name + val.id ditambahkan style */
- $('#' + val.name + val.id + '').css('color', 'black');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement