SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy append Statement needs to be broken for any element? Please HeLP

    This was created as simple jquery Store Cart feature. however, I am not as clean wiht getting the data to dynamically show to correct HTML5 elements (divs).

    This append Code sucks, but works. anytime I modify it, breaks give a NaN value for quantity

    Code:
    			$('#left_bar .cart-info').append('<dt class="clearfix first_item last_item" id="each-'+thisID+'"><span class="quantity-formated" ><span class="shop quantity">1</span>x</span><div class="label">'+itemname+'</div><div class="shop price"> $<em>'+itemprice+'</em></div><span class="shop quantity">1</span><img src="remove.png" class="remove" /><br class="all" /></dt>');
    I reall y want to just have the jquery vars go to HTML Div elements of choic i shopping cart.

    Can anyone look at this and tell me how to achieve that.

    ex: $('cart-product).find('quantity').html(iitemquanitity); something like this, wher eThe value can just be writte. The append is not working out.

    PLEASE HELP

  2. #2
    SitePoint Addict bronze trophy
    Join Date
    Sep 2005
    Posts
    317
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Hi @danjapro,

    Have you tried using parseInt() on your item quantity variable? You might want to check that the value of it is correct.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •