Wpis z mikrobloga

co robię źle?

request("[https://xd.xd](https://xd.xd)", function(err, resp, body){
var $ = cheerio.load(body);
var idArray = [];
$('div.post').each(function(){
var postId = $(this).attr('id');
if ($(this).classList.contains('sticky')) {
console.log("sticky");
} else {
console.log("nie sticky");
}
//idArray.push(postId);
//console.log(postId);
});
//console.log(idArray);
});

(to co jest zakomentowane bylo wczesniej i bez if i działało, jak dałem to if to nie działa ( ͡° ʖ̯ ͡°))

co robię źle?

#webdev #javascript
  • 11
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach