Proszę o przeróbkę prostego kodu javascript. Oto on:
var itemName = $(this).find(".smallimg").first().attr("alt"); if (itemName in PriceList) { $(this).find(".rarity").html(PriceList[itemName]); return; } $(this).find(".rarity").html("Loading ..."); var item =$(this); storage.get("currency", function(currency) { $.getJSON("http://steamcommunity.com/market/priceoverview/?currency="+currency+"&appid="+appId+"&market_hash_name=" + itemName, function(json){ var price = "Not found"; if (json.success){ if (typeof json.lowest_price != 'undefined') price = json.lowest_price; else if (typeof json.median_price != 'undefined') price = json.median_price; } PriceList[itemName] = price; item.find(".rarity").html(price); item.addClass("priced"); }).fail(function(){ item.find(".rarity").html("Not found"); item.addClass("priced"); }); }); });
Chcę aby kod nie zmieniał napisu w klasie "rarity" tylko aby dodawał klasę "priced" pod divem z klasą "item". W JS jestem noga, dlatego proszę was o pomoc.

// jeśli zły dział proszę o przeniesienie