Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Coy Sanders
@coymeetsworld
also your jQuery selectors are probably not what you want either
its not going to evaluate i in there, its a String
Luke
@lhovee
@coymeetsworld dang. How can I use jQuery with this array? I'm trying to abbreviate this code:
$("#state1").click(function() {
    $.getJSON("https://fcctop100.herokuapp.com/api/fccusers/top/recent", function(data) {
      $("#username1").html(data[0].username);
      $("#recent1").html(data[0].recent);
      $("#total1").html(data[0].alltime);
      $("#username2").html(data[1].username);
      $("#recent2").html(data[1].recent);
      $("#total2").html(data[1].alltime);
      $("#username3").html(data[2].username);
      $("#recent3").html(data[2].recent);
      $("#total3").html(data[2].alltime);
      $("#username4").html(data[3].username);
      $("#recent4").html(data[3].recent);
      $("#total4").html(data[3].alltime);
      $("#username5").html(data[4].username);
      $("#recent5").html(data[4].recent);
      $("#total5").html(data[4].alltime);
    });
  });
this is supposed to be repeated 100 times and I know writing 300 lines is the wrong answer
Coy Sanders
@coymeetsworld
you can still do that, just saying that "arr[i]" won't evaluate i or arr[i] for you
it will look for the id literally named "arr[i]"
Luke
@lhovee
@coymeetsworld don't I have to leave the "" in the jQuery?
Coy Sanders
@coymeetsworld
no you can put variables in there
the variable will have to be a String I believe
Luke
@lhovee
@coymeetsworld I see! fantastic I appreciate it
Coy Sanders
@coymeetsworld
like for example I have this in my Twitch code:
var iconColumn = $('<div>');
$(iconColumn).appendTo(channelItem);
also have something like this in my Simon code:
$(buttonObj.buttonID).css('background', buttonObj.buttonBG);
buttonObj is a JSON object and buttonID is a String property
Luke
@lhovee
@coymeetsworld I'm closer to something that works I think. Can you take a look at this and see if you can determine why it's not working?
$.getJSON("https://fcctop100.herokuapp.com/api/fccusers/top/alltime", function(data) {
      var arr = ["#username1", "#recent1", "#total1", "#username2", "#recent2", "#total2", "#username3", "#recent3", "#total3", "#username4", "#recent4", "#total4", "#username5", "#recent5", "total5"];
      for (var i = 0; i < arr.length; i++) {
        if (i == 0 || i == 3 || i == 6 || i == 9 || i == 12) {
          $(arr[i]).html(data[i].username);
        } else if (i == 1 || i == 4 || i == 7 || i == 10 || i == 13) {
          $(arr[i]).html(data[i].recent);
        } else if (i == 2 || i == 5 || i == 8 || i == 11 || i == 14) {
          $(arr[i]).html(data[i].total);
        }
      };
    });
  });
Coy Sanders
@coymeetsworld
that can be improved too, but I have another question, why do you need to add these to an id?
unless you're doing something that specifically targets each section that's probably not necessary
maybe just using jQuery's append would be better if you're just listing out users
Luke
@lhovee
@coymeetsworld I'm open to suggestions!
https://codepen.io/lhovee/pen/zBpXXm?editors=1010#0
Coy Sanders
@coymeetsworld
have you done all the Front End projects yet @lhovee?
Pitmation
@Pitmation
I am having issues with jQuery. Can someone give me guidance on how to make my name menu stay on top of page while all other content scrolls beneath it?
Coy Sanders
@coymeetsworld
don't think that's a jQuery issue @Pitmation, you can solve that with CSS if you want to fix the placement of something
max77p
@max77p
@coymeetsworld hey i am having trouble passing a function value into another function
hoping you can help me?
Coy Sanders
@coymeetsworld
which part?
max77p
@max77p
i want to pass the twitchLogo function here into the function below if (data.stream===null)
right now for simplicity sake i just want it to output to console
Pitmation
@Pitmation
@coymeetsworld would I do something like #navBar{

navbar{ position:fixed; background:absolute; z-index:500;

Coy Sanders
@coymeetsworld
@max77p does it matter if the channel is offline or not in order to get the logo? Shouldn't you get it regardless?
max77p
@max77p
@coymeetsworld yes correct, but just playing with this right now to understand
so i am strictly trying to pull the logo for offline only
Coy Sanders
@coymeetsworld
yeah but not sure why, since you're going to rewrite it anyways
the code you have not guaranteed to work the way you want it to either @max77p, because of the nature of asynchronous calls
Kevin K. Lee
@kevinkiklee
@max77p hey sup again
@max77p if you want to test just the logo, try this:
 $.getJSON('https://api.twitch.tv/kraken/channels/StrelokRage', function(data) {
   console.log(data.logo); 
   });
(strelokrage is a friend of mine)
that's the output i got from the console
Pitmation
@Pitmation
Can someone help me with my nav bar?
I want to make it static so it doesn't move from the top but everything below its scrolls
Rada
@Radascript
@Pitmation you are looking for fixed positioning
@Pitmation or if you are using bootstrap, read their docs, they have some classes for navbar
Kevin K. Lee
@kevinkiklee
@Pitmation here is another link for you to learn from http://lmgtfy.com/?q=how+to+make+a+menu+static+with+css
Pitmation
@Pitmation
@iserbit thank you
CamperBot
@camperbot
pitmation sends brownie points to @iserbit :sparkles: :thumbsup: :sparkles:
:cookie: 293 | @iserbit |http://www.freecodecamp.com/iserbit
Rada
@Radascript
@iserbit savage XD
Kevin K. Lee
@kevinkiklee
oh i was totally trolling =D