Answer the question
In order to leave comments, you need to log in
Comparing variable values?
Cannot get equality of two variables when comparing them if( sran == ravno)
Variable values are compared. Please help me find the error
var sran = data.steamid.toString();
if($("div").is(".item_user_steam")){
//
if( sran == ravno){
var item = '<div style="background: transparent url("images/'+testbg+'.png") no-repeat scroll -18px -14px / cover ;" class="south" >';
item += '<img class="item" data-title="'+data.itemname+'" src="http://steamcommunity-a.akamaihd.net/economy/image/'+ data.image +'/50fx50f" alt="" title="" /><div class="price_main">'+data.cost+''+currency+'</div>';
item += '</div>';
$parent.find('.items:first').append(item);
var ravno = data.steamid;
}else{
var ravno = data.steamid.toString();
var block = '<div class="short item_user_steam">';
block += '<div class="top_main"><div class="avatar"><img src="'+data.ava+'" alt="" title="" /></div>';
block += '<div class="avatar_left"><ul>\
<li>'+data.user+'</li>\
<li>'+ravno+'</li>\
<li>'+sran+'</li>\
<li>внес <span id="tb_count_steam">'+getWordNormal(data.itemcounter,'вещь','вещи','вещей')+'</span></li>\
<li>на сумму <span id="total_item_price">'+data.money+' </span> <span>руб</span></li>\
<li class="bilet1"><b>Билеты от #'+ddk+' до #'+ntk+'</b> <li>\
<li class="main_percent"> <div class="percent">'+data.chance.toFixed(1)+'%</div></li>\
</ul></div></div>';
block += '<div class="items " >';
block += '<div style="background: transparent url("images/'+testbg+'.png") no-repeat scroll -18px -14px / cover ;" class="south" original-title="Название предмета">';
block += '<img class="item" data-title="'+data.itemname+'" src="http://steamcommunity-a.akamaihd.net/economy/image/'+ data.image +'/50fx50f" alt="" title="" /><div class="price_main" >'+data.cost+''+currency+'</div>';
block += '<div style="clear"></div></div>';
block += '</div>';
$parent.find('.item_user_steam:first').before(block);
}
}
else {
var ravno = data.steamid.toString();
var block = '<div class="short item_user_steam">';
block += '<div class="top_main"><div class="avatar"><img src="'+data.ava+'" alt="" title="" /></div>';
block += '<div class="avatar_left"><ul>\
<li>'+data.user+data.steamid+'</li>\
<li>внес <span id="tb_count_steam">'+getWordNormal(data.itemcounter,'вещь','вещи','вещей')+'</span></li>\
<li>на сумму <span id="total_item_price">'+data.money+data.steamid+' </span> <span>руб</span></li>\
<li class="bilet1"><b>Билеты от #'+ddk+' до #'+ntk+'</b> <li>\
<li class="main_percent"> <div class="percent">'+data.chance.toFixed(1)+'%</div></li>\
</ul></div></div>';
block += '<div class="items" >';
block += '<div style="background: transparent url("images/'+testbg+'.png") no-repeat scroll -18px -14px / cover ;" class="south" original-title="Название предмета">';
block += '<img class="item" data-title="'+data.itemname+'" src="http://steamcommunity-a.akamaihd.net/economy/image/'+ data.image +'/50fx50f" alt="" title="" /><div class="price_main" >'+data.cost+''+currency+'</div>';
block += '<div style="clear"></div></div>';
block += '</div>';
$parent.append(block);
};
Answer the question
In order to leave comments, you need to log in
Неужели все это нужно для примера?
Сделайте
и посмотрите может это очевидно. Либо укоротите пример, в таком очень долго разбираться.
Что-то мне подсказывает, что ravno в этом примере имеет значение undefined
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question