These are chat archives for FreeCodeCamp/HelpFrontEnd

29th
May 2016
Karlo Mirkovic
@respectTheGrind
May 29 2016 00:04 UTC
http://codepen.io/respectTheGrind/pen/rLNeXb
Hello guys, I can't seem to figure out how to erase the white border between the navbar and the <div> tag with the "hello world" text. What should I do?
MBJ
@mbjusa
May 29 2016 00:14 UTC
I am on the twitch tv project but I am having trouble controlling the program flow due to the asynch nature of js.
I could use some guidance.
Anyone game?????
Justin Woodward
@jwoo92
May 29 2016 00:59 UTC
hey guys i am having a little bit of trouble getting my on click functions to work for my buttons on my twitch.tv app. would anyone be able to look over my code for me please? http://codepen.io/jwoo/pen/bebYLO?editors=0110
JohnnyZampano
@JohnnyZampano
May 29 2016 01:11 UTC
Hello, i'm on my first project and have some basic questions. Right now the page looks good on my browser, but if i make the window smaller is squishes and messes everything up. How do I get elements to stay within their backgrounds? For example the text at the top squishes out of the background when the window is adjusted smaller: http://codepen.io/JeffreySnowden/pen/OXJjWq Thanks!
and why is there a space above my image and text? It doesn't show up anywhere else when i run the html
jinrawx
@jinrawx
May 29 2016 01:23 UTC

@JohnnyZampano : for the "squishing thing," I recommend you either look up a few articles on responsive web design, OR look up how to use twitter bootstrap and it's grid system.

as for the space above your image and image and text, you can debug this issue by trying out chrome developer tools. on google chrome, right click the element and click the inspect option. You should be able to see the classes of the object to the right, which reveal the applied styles and where the styles were applied from(your own styles, or some vendor css). Also, at the bottom of the applied styles, you can see the margin and padding of an element.

(of the element*)
JohnnyZampano
@JohnnyZampano
May 29 2016 01:26 UTC
@jinrawx Thank you! Exactly what I needed.
CamperBot
@camperbot
May 29 2016 01:26 UTC
johnnyzampano sends brownie points to @jinrawx :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @jinrawx |http://www.freecodecamp.com/jinrawx
jinrawx
@jinrawx
May 29 2016 01:27 UTC
@JohnnyZampano : no problemo. =]
Ken Haduch
@khaduch
May 29 2016 01:46 UTC
@jwoo92 - I"m taking a look - it looks like everything loads initially?
Justin Woodward
@jwoo92
May 29 2016 01:47 UTC
@khaduch i have everything set in my doc ready function. i cant seem to get my button triggers to work properly.
Ken Haduch
@khaduch
May 29 2016 01:48 UTC
@jwoo92 - one thing that you might be able to change is just to keep all of the data for all of the users, and then instead of requesting the new list of offline and online, you could just filter them out from the list and re-display the part of interest? But that's not the button problem... still looking.
Greg Duncan
@GregatGit
May 29 2016 01:58 UTC
@jwoo92 I think you're online/offline/all functions are over done
@jwoo92 You don't need a loop or anything complicated
Ken Haduch
@khaduch
May 29 2016 02:00 UTC
@jwoo92 - I think that your functions offlineUser, onlineUserand getStreamer are just out of scope for your click handlers, since they are defined inside the click handler for the twitch icon...
Greg Duncan
@GregatGit
May 29 2016 02:04 UTC

@jwoo92

$('.online').hide();
$('.online').show();

first will target anything with the online class and hide - the second does the opposite

Justin Woodward
@jwoo92
May 29 2016 02:12 UTC
@khaduch ill correct that, i am looking for the closing for it.
Justin Woodward
@jwoo92
May 29 2016 02:19 UTC
@khaduch thanks, that solved the inital problem of being out of scope. i now need to revise my online and offline users.
CamperBot
@camperbot
May 29 2016 02:19 UTC
jwoo92 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1219 | @khaduch |http://www.freecodecamp.com/khaduch
Justin Woodward
@jwoo92
May 29 2016 02:19 UTC
@GregatGit i am looking into that.
Greg Duncan
@GregatGit
May 29 2016 02:20 UTC
@jwoo92 your function should be very small - two line - maybe three
Justin Woodward
@jwoo92
May 29 2016 02:21 UTC
@GregatGit here it is, i am just thinking on what to grab to make it work.
$("#offline").on("click", function() {
   $("#streamers").html('');
   $(".online").hide();
 });
Ken Haduch
@khaduch
May 29 2016 02:21 UTC
@jwoo92 - BTW - I was looking through the code trying to sort it out, and remembered to check the developer's tools console - I saw it reporting errors on non-existent functions. So that's a good tool. The CodePen JS config button also has a rather useful tool at the bottom of the popup - "Analyze JS" - it is flagging several things that might have been helpful to examine. Just in case you don't know about those tools...
Greg Duncan
@GregatGit
May 29 2016 02:22 UTC
@jwoo92 what does this line do $("#streamers").html('');
Justin Woodward
@jwoo92
May 29 2016 02:23 UTC
@GregatGit lol! completely looked over that! thank
CamperBot
@camperbot
May 29 2016 02:23 UTC
jwoo92 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 536 | @gregatgit |http://www.freecodecamp.com/gregatgit
Justin Woodward
@jwoo92
May 29 2016 02:23 UTC
@khaduch thank you, i was not aware of those tools!
CamperBot
@camperbot
May 29 2016 02:23 UTC
jwoo92 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: jwoo92 already gave khaduch points
Greg Duncan
@GregatGit
May 29 2016 02:24 UTC
@jwoo92 while you are hiding online you may have to show offline if they have been hiden
Justin Woodward
@jwoo92
May 29 2016 02:24 UTC
@GregatGit i just realized that.
@khaduch @GregatGit feel free to take a look now. http://codepen.io/jwoo/full/bebYLO/
Nooruddin
@nooruddin
May 29 2016 02:27 UTC
Build this flipping card, facebook profile style tribute page.
https://codepen.io/menwhopaused/pen/yOmEZw/
Greg Duncan
@GregatGit
May 29 2016 02:28 UTC
@jwoo92 It's a great looking page - well done
Nooruddin
@nooruddin
May 29 2016 02:30 UTC
Any review comments on my tribute page?
Justin Woodward
@jwoo92
May 29 2016 02:30 UTC
@GregatGit thanks again greg. i started this one last night. i stayed up all night just to wipe my js out and started over. i forced myself to start to use proper function creation and readabilty throughout my js. i am very happy and proud of the outcome.
CamperBot
@camperbot
May 29 2016 02:30 UTC
jwoo92 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: jwoo92 already gave gregatgit points
Ken Haduch
@khaduch
May 29 2016 02:34 UTC
@jwoo92 - yes, it looks very nice, great styling and functionality. I just took a look at the HTML panel - you should not have the <body> tag in the HTML panel, CodePen takes care of that with the template that it uses. (Of course, you can still style it with your body CSS rule, since that tag will be in the generated page.) Also, your responsive behavior, well, isn't... I didn't try it on a real mobile device, but on a narrowing browser window, things fall apart in the display. On a phone, it doesn't look good in the "portrait" mode, but okay in the "landscape" mode. Just thought I would pass it along - not sure if you are concerned about that at this point, but I think that on the full-screen view, it looks top-notch!
Greg Duncan
@GregatGit
May 29 2016 02:35 UTC
@jwoo92 It's great! It has a few minor problems with its responsiveness (the description of offline drops out) but this is one of the better Twitch projects i've seen.
Justin Woodward
@jwoo92
May 29 2016 02:37 UTC
@khaduch @GregatGit i agree, i know the responsiveness was off when resizing. i didnt come up with a solution to it earlier, but maybe now would be a good time for me to correct it with the more complicated stuff out of the way.
would you guys have any suggestions?
Greg Duncan
@GregatGit
May 29 2016 02:39 UTC
@jwoo92 I am trying to make mine responsive too - it looks no where near as good as yours
Ken Haduch
@khaduch
May 29 2016 02:40 UTC

@jwoo92 - yeah, I just keep thinking that depending on who sees your portfolio and tries to view it on a mobile device, potentially, you'd want it to look good there, too.

I haven't even started mine - I spend too much time in the help rooms and doing a few other learning activities... I hope it turns out as nicely as yours!

redixhumayun
@redixhumayun
May 29 2016 03:10 UTC

http://codepen.io/redixhumayun/pen/rLNzpm?editors=0112

Hey, I'm having some trouble getting the weather API to run. I don't seem to be getting a response on the console when I console.log(json) in the above code. I've tried passing my lat and long as both variables and numbers directly. I've signed up for the API key and included it in the API call, and still no luck. Can anybody help me out here?

Bruce Young
@mutantspore
May 29 2016 03:12 UTC
@redixhumayun range of issues .. add http:// to owm api call
redixhumayun
@redixhumayun
May 29 2016 03:12 UTC
range of issues?
Bruce Young
@mutantspore
May 29 2016 03:13 UTC
@redixhumayun wrap a funcyion around teh weathe rapi and call it from inside the geolocation.. it’s ascychronous
if you are using chrome it won’t work anyway
redixhumayun
@redixhumayun
May 29 2016 03:13 UTC
@mutantspore It says there is an error and the city is not found. But my geolocation works perfectly
@mutantspore Why won't it work with chrome? I'm running version 49 of chrome. I thought the issue was with 50 and upwards
Bruce Young
@mutantspore
May 29 2016 03:14 UTC
ok yes.. BUT everyone else wil be using it
redixhumayun
@redixhumayun
May 29 2016 03:14 UTC
@mutantspore Can you explain what you mean by wrapping the function? Do you just mean including the api call within my geolocation function?
Bruce Young
@mutantspore
May 29 2016 03:15 UTC
eithe rthat or makethe owm api call a function and call it from inside teh geolocation
redixhumayun
@redixhumayun
May 29 2016 03:15 UTC
@mutantspore Why does that make a difference?
It is still giving me an error saying location not found. Any clue why?
Bruce Young
@mutantspore
May 29 2016 03:16 UTC
did you put http:// as part of the OWM URL?
redixhumayun
@redixhumayun
May 29 2016 03:17 UTC
@mutantspore Yep, the api call works, but it returns an error saying the city is not found. Is it because I'm trying to pass variables as my parameters to the api call?
Bruce Young
@mutantspore
May 29 2016 03:17 UTC
the gelocation is acychronous.. it goes off to do it .. you don’t know when it will get back.. menwhile it tries to run the OWM api .. which is also async..
redixhumayun
@redixhumayun
May 29 2016 03:18 UTC
@mutantspore So I just wait for it to work basically?
@redixhumayun this has a good explaination - about 4 mins longs - about your problem
Bruce Young
@mutantspore
May 29 2016 03:21 UTC
@redixhumayun you are also not actually passing teh lat/lon as variable. but as text
redixhumayun
@redixhumayun
May 29 2016 03:22 UTC
@mutantspore yeah you're right
@mutantspore I just escaped the double quotes
Bruce Young
@mutantspore
May 29 2016 03:22 UTC
@redixhumayun that's a fork of yours
redixhumayun
@redixhumayun
May 29 2016 03:22 UTC
@mutantspore It worked, thank you so much
CamperBot
@camperbot
May 29 2016 03:22 UTC
redixhumayun sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1650 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
May 29 2016 03:24 UTC
@redixhumayun now abandon the use of the HTML5 geolocation and use something like http://ip-api.com for the lat/lon so as others won’t have Chrome issues using you rapp
redixhumayun
@redixhumayun
May 29 2016 03:26 UTC
@mutantspore I just looked at the link you provided and it says to submit a GET request. I have a quick, stupid question about that. Is submitting a GET request analogous to submitting a $.getJSON request? Will I get the same result regardless? Or does $.getJSON not work when you are explicitly required to submit a GET request?
Candice
@smrtsmrf
May 29 2016 03:27 UTC
does someone want to help me debug a part of my tic tac toe project?
Bruce Young
@mutantspore
May 29 2016 03:29 UTC
@redixhumayun was that Greg? not me
redixhumayun
@redixhumayun
May 29 2016 03:29 UTC
@mutantspore Umm.. no it was you who provided the link http://ip-api.com
Bruce Young
@mutantspore
May 29 2016 03:30 UTC
@redixhumayun ok wel the getjson wil work fine
Candice
@smrtsmrf
May 29 2016 03:31 UTC
the smartAI for my tic tac toe isn’t working as I want it to
Bruce Young
@mutantspore
May 29 2016 03:31 UTC
@redixhumayun full working example at the end of this page
http://ip-api.com/docs/api:json
Eric Murta
@murtinha
May 29 2016 03:32 UTC
Guys, I'm having problems with my userPlay function, I need it to mark the X or O wherever row/column the player clicks...
http://codepen.io/murtinha/pen/VaJmgM?editors=1000
redixhumayun
@redixhumayun
May 29 2016 03:32 UTC
@mutantspore Thanks
CamperBot
@camperbot
May 29 2016 03:32 UTC
redixhumayun sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: redixhumayun already gave mutantspore points
Bruce Young
@mutantspore
May 29 2016 03:33 UTC
This message was deleted
SarthakAdhikari
@SarthakAdhikari
May 29 2016 03:37 UTC
Hello.
Elbert Cortez
@trip16661
May 29 2016 03:41 UTC
How can i tore ajax json response into javascript variable using promise
Justin Woodward
@jwoo92
May 29 2016 03:42 UTC
@GregatGit @khaduch fixed the responsive part for the most part. i just need to fix the buttons when in portrait mode. http://codepen.io/jwoo/full/bebYLO/
Greg Duncan
@GregatGit
May 29 2016 03:46 UTC
@jwoo92
       <div id="buttons">
          <div class="btn-group btn-group-lg">
            <div class="row">
              <button id="all" class="btn btn-info">ALL</button></li>
              <button id="online" class="btn btn-success">ONLINE</button></li>
              <button id="offline" class="btn btn-danger">OFFLINE</button></li>
            </div>
          </div>
        </div>
@jwoo92 I would just stick them in a row
Elbert Cortez
@trip16661
May 29 2016 03:48 UTC
How can i store ajax json response into javascript variable using promise
Justin Woodward
@jwoo92
May 29 2016 03:48 UTC
@GregatGit great idea, that works perfectly with it.
Bruce Young
@mutantspore
May 29 2016 03:49 UTC
@trip16661 perhaps this wil help
https://www.youtube.com/watch?v=obaSQBBWZLk
Eric Murta
@murtinha
May 29 2016 03:50 UTC
@mutantspore can you help me?
Bruce Young
@mutantspore
May 29 2016 03:59 UTC
@murtinha you’ll need a click function to deal with the mouse click events on a square by the user and a “flag” to keep track of who’s move it it is.
Greg Duncan
@GregatGit
May 29 2016 03:59 UTC
@murtinha first thing you need to do in your html is get rid of all the blank lines make is hard to read
Eric Murta
@murtinha
May 29 2016 04:00 UTC
@GregatGit forget about the html hahaha
@mutantspore I tried to keep track of the clicks by rowIndex and cellIndex, but I think I'm using them the wrong way
Greg Duncan
@GregatGit
May 29 2016 04:07 UTC
@murtinha in code pen everything in the html section is already wrapped in the body tags - all libraries - js - css - fonts - get added in the settings - here is how the html you wrote should look
<table id="tictac">
  <tr id="row1">
    <td id="col11" class="col1">
    </td>
    <td class="col1  col2">
    </td>
    <td id="col12" class="col1">
    </td>
    <td class="col1 col4">
    </td>
    <td id="col13" class="col1">
    </td>
  </tr>
  <tr id="row2">
    <td class="row2  col2">
    </td>
    <td class="row2  col2">
    </td>
    <td class="row2">
    </td>
    <td class="row2 col4">
    </td>
    <td class="row2">
    </td>
  </tr>
  <tr id="row3">
    <td id="col21" class="col3">
    </td>
    <td class="col3  col2">
    </td>
    <td id="col22" class="col3">
    </td>
    <td class="col3 col4">
    </td>
    <td id="col23" class="col3">
    </td>
  </tr>
  <tr id="row3">
    <td class="row4">
    </td>
    <td class="row4  col2">
    </td>
    <td class="row4">
    </td>
    <td class="row4  col4">
    </td>
    <td class="row4">
    </td>
  </tr>
  <tr id="row5">
    <td id="col31" class="col5">
    </td>
    <td class="col5  col2">
    </td>
    <td id="col32" class="col5">
    </td>
    <td class="col5 col4">
    </td>
    <td id="col33" class="col5">
    </td>
  </tr>
</table>
Eric Murta
@murtinha
May 29 2016 04:07 UTC
@GregatGit thats because I copied it straight from my sublimetext...
Greg Duncan
@GregatGit
May 29 2016 04:10 UTC
@murtinha You really should only have 3 rows
Eric Murta
@murtinha
May 29 2016 04:11 UTC
@GregatGit I have 5 rows because I made the # shape outta 2 of them
Greg Duncan
@GregatGit
May 29 2016 04:14 UTC
@murtinha clearly you have a better handle on css than you do on js - use your css so you have 3 rows of three - then give those 3 X 3 a border -
Bruce Young
@mutantspore
May 29 2016 04:16 UTC
@murtinha yes i don’t quite know what you are doing but you need to do stuff inside that click function in the userPLay and actually call it somewhere to get it going. I’ve added a console.log and the clicks are there but that row/col bit won’t do anthing outside teh function.. even if it was right
http://codepen.io/MutantSpore/pen/Bzawao?editors=1010
Eric Murta
@murtinha
May 29 2016 04:20 UTC
@mutantspore yeah... its returnig undefined, what I wnat to do is to make a simple function that on click it marks X or O in the right place depending where the user clicked, so I tryied to track the row and the col he clicked and put it there so it would mark it
Brendon
@Balvamar
May 29 2016 04:28 UTC
can anyone help with the "quote machine" challenge? I am unable to get an api to work
Greg Duncan
@GregatGit
May 29 2016 04:48 UTC
@Balvamar just post your pen up -
jinrawx
@jinrawx
May 29 2016 04:53 UTC
yooo anyone here pretty good with configuring gulpfiles?
Greg Duncan
@GregatGit
May 29 2016 04:56 UTC
@smrtsmrf Looks great (tho I personally don't like the green) - but I have beaten smart AI a couple of times
Candice
@smrtsmrf
May 29 2016 04:57 UTC
@GregatGit yeah, I’ve beaten it too. Not quite sure how to better implement the choice it makes when it’s not placing a winning or blocking move
Greg Duncan
@GregatGit
May 29 2016 05:00 UTC
@smrtsmrf If the user moves into the center the computer has to choose a corner
@smrtsmrf the computer has also failed to block me from winning
Candice
@smrtsmrf
May 29 2016 05:02 UTC
@GregatGit Ok, I’ll add that into the code. Thanks. But it failed to block you? I thought I had that worked out - except for when it I can win in two places
CamperBot
@camperbot
May 29 2016 05:02 UTC
smrtsmrf sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 537 | @gregatgit |http://www.freecodecamp.com/gregatgit
Sacha Morgese
@TheOmegaBlack
May 29 2016 05:51 UTC
Hi there, I am pretty much done with my "show the local weather" project, but I am having troubles in toggling between Fahrenheit and Celsius. I have tried different ways and all of them failed. I don't want to convert but just use the different value contained in the json from wunderground but my anchor just converts once to F and then stops... anyonw who can help me?
kirbyedy
@kirbyedy
May 29 2016 06:06 UTC
@TheOmegaBlack hmmmm small problem here
check the image @TheOmegaBlack
Screen Shot 2016-05-29 at 09.05.52.png
regarding the other issue, maybe you should try to use toggle()
Coy Sanders
@coymeetsworld
May 29 2016 06:10 UTC
@smrtsmrf if you want to make it unbeatable look into the Minimax algorithm, that's what I used. But you don't need to make the game unbeatable anymore I guess
Nate Mamman
@oiclid
May 29 2016 07:14 UTC
@AryanSingh
Nick Svanidze
@nikasvan
May 29 2016 07:27 UTC
Hi Guys I am on Twitch JSON API project and having a weird bug. Code works only when debugging the script in dev tools. Am I missing anything?
$(document).ready(function() {
        var channels = ["OgamingSC2","sheevergaming", "ESL_SC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
        for (var i = 0; i < channels.length; i++) {
            $.getJSON('https://api.twitch.tv/kraken/streams/' + channels[i] + '?callback=?', function(data) {
                if (data.stream) {
                    $('.wrapper li').eq(i).css('background-color', "blue");
                } else {
                    $('.wrapper li').eq(i).css('background-color', "red");
                }

            });
        };

    })
Here is the full code http://codepen.io/nikasv/pen/GqRMXq
Jordi Vilagut Treserra
@jordivilagut
May 29 2016 08:10 UTC
hello guys
maybe someone can help me with this pen, is the Twitch TV project
the problem is that I want to show the Channel Name, and i call my array codeStreamers
so for every channel i do a call to codeStreamers[i]
being i a var that goes through all the streamers
but it gives me back --> undefined
instead, if i call codeStreamers[1] or codeStreamers[2], it gives me back the right name on that array position
any ideas why the [i] call isn't working?
thanks in advance
Bruce Young
@mutantspore
May 29 2016 08:29 UTC
On a phone so I can't help much. Replace your for loop with a .forEach
Bruce Young
@mutantspore
May 29 2016 08:36 UTC
I see both @bcnjordi9 and @nikasvan have the same issue. Use .forEach instead of a for loop
Bruce Young
@mutantspore
May 29 2016 09:30 UTC
@nikasvan as I said earlier use .forEach. .. and you didn’t have jQuery loaded anyway.
http://codepen.io/MutantSpore/pen/EyxbKY?editors=0110
Bruce Young
@mutantspore
May 29 2016 09:48 UTC
@bcnjordi9 there were a lot of syntax errors and variables out of scope , unnecessary code and the .forEach as I said before. You need to also make a call to channels to get the info of those offline.
http://codepen.io/MutantSpore/pen/pbodyQ?editors=1010
Nguyễn Quốc Đại
@nqdai1992
May 29 2016 10:00 UTC
hi guys, I'm make random quotes and I search google then find the link "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1". When i reload on browse that print random quote but I write on codepen it show only one result. Any one have gone through this problem? Help me please :D
Islam Ibakaev
@dagman
May 29 2016 10:26 UTC
hey guys how this looks?
shivamsonu29
@shivamsonu29
May 29 2016 10:31 UTC

var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
function updateRecords(id, prop, value) {
if(value!=="")
{
if(collection[id][prop]!="tracks")
{
collection[id][prop]=value;
}
else{

    collection[id].tracks.push(value);
}

}
else {delete collection[id][prop];}

return collection;
}

in the following code how to insert value in 1245->tracks->[]..
tried push but not working!!
NegrilloC
@NegrilloC
May 29 2016 11:51 UTC
@dagman It looks amazing! but the intro text could be smaller
Ken Haduch
@khaduch
May 29 2016 12:07 UTC
@jwoo92 - Nice - definitely looks better on the phone screen! Good work!
@shivamsonu29 - hello there - your check for value !=="" is correct, you should have a similar test of the prop variable, where you are checking to see if they are working with tracks. Looks like you are going immediately into the object to check it.
James Winfield
@jamesthemonkeh
May 29 2016 12:11 UTC
Hello, is anyone able to advise on using JSON on the random quote generator please?
Yaroslav
@YVeselovskyi
May 29 2016 12:20 UTC
hello :)
I want to clear my calculator input before entering another value after choosing operator
how to do it?
like in simple calculators
Ken Haduch
@khaduch
May 29 2016 12:26 UTC
@YVeselovskyi - without seeing your code - you should have a function that does what sounds like a partial clear of the calculator - just have it clear the value that you are accumulating from the keypresses, the display value, and any state associated with entering the new value should be reset as if it was cleared. Sounds like a plan to me.
@nqdai1992 - can you post a link to you page?
@dagman - wow, you've really been working hard on that! It looks pretty cool - lots of action there!
Nguyễn Quốc Đại
@nqdai1992
May 29 2016 12:29 UTC
sorry i modify code but i use getJSON. $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
$("body").append(a[0].content + "<p>— " + a[0].title + "</p>")
});
Yaroslav
@YVeselovskyi
May 29 2016 12:33 UTC
@khaduch thanks
CamperBot
@camperbot
May 29 2016 12:33 UTC
yveselovskyi sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1220 | @khaduch |http://www.freecodecamp.com/khaduch
Yaroslav
@YVeselovskyi
May 29 2016 12:33 UTC
but where I will save previous value ?
Ken Haduch
@khaduch
May 29 2016 12:34 UTC
@nqdai1992 - I cannot tell too much from that - if you are in CodePen, you might be running into problems using HTTPS vs. HTTP or something like that?
@YVeselovskyi - you have to structure your code to do this type of operation - you might have to separate the logic that is handling the accumulated information (previously entered number and any operations that you want to keep) from the number that is currently being entered into the input. I'm just giving a theoretical answer - it should be something that you can implement - but without seeing how your code is structured, I cannot make any more specific recommendation. But I hope that the idea helps you?
Yaroslav
@YVeselovskyi
May 29 2016 12:39 UTC
blob
here it is :)
shivamsonu29
@shivamsonu29
May 29 2016 12:47 UTC
@khaduch thanks for your reply!!! the problem is solved..
CamperBot
@camperbot
May 29 2016 12:47 UTC
shivamsonu29 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1221 | @khaduch |http://www.freecodecamp.com/khaduch
Nguyễn Quốc Đại
@nqdai1992
May 29 2016 13:10 UTC
i can't make random quote
Ken Haduch
@khaduch
May 29 2016 13:11 UTC
@YVeselovskyi - oh, that's ES6, huh? I'm not familiar with that, it would take me some time to even sort out what you were doing... I guess I'll have to try and spend some time learning that as I see it popping up more and more... I won't have time to really dig into it at this point of the day.
Yaroslav
@YVeselovskyi
May 29 2016 13:15 UTC
yes, it's becoming more popular I think every day :D
@khaduch thanks, I will try how to do it
CamperBot
@camperbot
May 29 2016 13:15 UTC
yveselovskyi sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: yveselovskyi already gave khaduch points
Ken Haduch
@khaduch
May 29 2016 13:20 UTC

@nqdai1992 - I just opened this CodePen link, and tried it, and it only seems to be getting one quote - it might be caching the request somewhere? Just on a hunch, I switched to the JSONP format, then next thing they show on the page, made a change to the code to look like this:

$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=?",function(data){

and it seems to be getting different quotes. Want to see if that works for you?

Nguyễn Quốc Đại
@nqdai1992
May 29 2016 13:26 UTC
oh thanks @khaduch it work :D How do you find the solution. I'm newbie
CamperBot
@camperbot
May 29 2016 13:26 UTC
nqdai1992 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1222 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
May 29 2016 13:28 UTC
@nqdai1992 - I just looked down the page on the http://quotesondesign.com/api-v4-0/ documentation and tried the next solution - just a hunch, as I said, because I know that I've seen this work for people, I couldn't remember what they used. Good luck finishing it - I have to run!
Nguyễn Quốc Đại
@nqdai1992
May 29 2016 13:32 UTC
i have a question more. "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=?" why I write in codepen it work but I copy link to browse it dosen't work
shamieya
@shamieya
May 29 2016 14:02 UTC
Twitch TV project - calling it done https://codepen.io/shamieya/full/EKBaEM/
Adetunji Iyaniwura
@Iadetunji
May 29 2016 14:03 UTC
shamieya
@shamieya,ur work is cool,could reflect some creativity
shamieya
@shamieya
May 29 2016 14:04 UTC
ya, it's pretty plain. I might go back and add some design elements or something.
Adetunji Iyaniwura
@Iadetunji
May 29 2016 14:05 UTC
shamieya
@shamieya,you could try bootstrap
shamieya
@shamieya
May 29 2016 14:11 UTC
thanks @Iadetunji
CamperBot
@camperbot
May 29 2016 14:11 UTC
shamieya sends brownie points to @iadetunji :sparkles: :thumbsup: :sparkles:
:cookie: 133 | @iadetunji |http://www.freecodecamp.com/iadetunji
Robert-Jan
@Zorba68
May 29 2016 14:32 UTC
help repeats
CamperBot
@camperbot
May 29 2016 14:32 UTC

:point_right: algorithm no repeats please [wiki]

Algorithm No Repeats Please

Problem Explanation:

This task requires us to look at each possible permutation of a string. This can be done using a recursion function, but it is not the only way. A common interview question is building a function which collects all permutations of a string. So there is no shortage of tutorials out there on how to do this, in many different code languages.

:pencil: read more about algorithm no repeats please on the FCC Wiki

NewtonXu
@NewtonXu
May 29 2016 14:58 UTC
Was building the wikipedia viewer and testing some code and received: "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access."
Is codepen blocked form using the wikipedia API?
Joost
@joostvanheesbeen
May 29 2016 15:00 UTC
Hi All,
Making the weather app.. struggling to save the city I got from the API in a variable... anyone able to help me out please?
http://codepen.io/joostvanheesbeen/pen/LZYOEV?editors=1010
I thought it was already in the 'myCity' variable but console.logging that variable give me 'undefined'
NewtonXu
@NewtonXu
May 29 2016 15:04 UTC
@joostvanheesbeen so you wanted the city from the API json return? its called myCity['sys']['name']
unless im misunderstanding your question
oh sorry i misunderstood, ill take another look
Joost
@joostvanheesbeen
May 29 2016 15:05 UTC
I've got the city already pushed into the HMTL
just don't know how I can use it for the second API call through that..
(append it in the URL for that call)
NewtonXu
@NewtonXu
May 29 2016 15:06 UTC
you mean in the part you commented out correct?
Joost
@joostvanheesbeen
May 29 2016 15:06 UTC
yes
just trying to figure the variable thing out first- took a step back sort of
zrogravit247
@zrogravit247
May 29 2016 15:12 UTC
Hi can anyone help me or link me to a page that can teach me how to change highlights in the nav bar as I scroll through my portfolio?
any idea @NewtonXu
?
NewtonXu
@NewtonXu
May 29 2016 15:18 UTC
@joostvanheesbeen i suspect it may be that youre saving mycity locally in your ajax call but im not sure if thats how ajax works, you could always just get it out of the html you just saved it to though
Joost
@joostvanheesbeen
May 29 2016 15:19 UTC
@NewtonXu ok, but how?
and I thought var $myCity = $('#myCity');should put the city in a variable?
NewtonXu
@NewtonXu
May 29 2016 15:20 UTC
mycity = $('b').html();
Joost
@joostvanheesbeen
May 29 2016 15:20 UTC
what's the 'b' for?
NewtonXu
@NewtonXu
May 29 2016 15:21 UTC
b is the bold tag, between the bold tag you saved your city in your javascript
im not too sure what var $myCity = $('#myCity'); does
try console.log right after that line and see what comes out?
Joost
@joostvanheesbeen
May 29 2016 15:25 UTC
thought that's what saves the city from the API call into a variable
very confused now haha
console.log(myCity); if i add this after that line it just gives me the div that holds #myCity
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:28 UTC
http://codepen.io/sarthakadhikari/pen/OXJxVy/
I want my search bar to come just below the heading(i.e "THE WIKIPEDIA VIEWER") but I don't know what I am doing wrong. Can anyone help?
vikranthkeerthipati
@vikranthkeerthipati
May 29 2016 15:32 UTC
did u change the alignment of the textbox?
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:33 UTC
alignment?
vikranthkeerthipati
@vikranthkeerthipati
May 29 2016 15:37 UTC
<div style="margin:0 auto;width:75%;text-align:left">
try this
it may help
actually nvm
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:38 UTC
:P
Justin Woodward
@jwoo92
May 29 2016 15:39 UTC
@SarthakAdhikari i fixed it for you
vikranthkeerthipati
@vikranthkeerthipati
May 29 2016 15:39 UTC
all you do is add <center> tags on either side of the code you want to center
Justin Woodward
@jwoo92
May 29 2016 15:39 UTC
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:39 UTC
@Vikranth-Keerthipati <center> is going to be outdated soon
vikranthkeerthipati
@vikranthkeerthipati
May 29 2016 15:39 UTC
oh ok
why though?
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:40 UTC
@jwoo92 The box doesn't still move up, i mean it doesn't get close to the heading
Justin Woodward
@jwoo92
May 29 2016 15:40 UTC
@SarthakAdhikari i just resaved. i forgot to save it.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:40 UTC
:P
Justin Woodward
@jwoo92
May 29 2016 15:41 UTC
@SarthakAdhikari do you want it closer to the heading still?
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:41 UTC
Yes :D
after I click the button though :D
I mean it should go close to the heading after the "GO!" button is clicked.
Justin Woodward
@jwoo92
May 29 2016 15:44 UTC
@SarthakAdhikari so not this? http://codepen.io/jwoo/pen/gMOoNY
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:47 UTC
@jwoo92 No, I mean like I want the "Click here for a random Article" to disappear and the Searchbox to get near the heading "after I click the search button".
Justin Woodward
@jwoo92
May 29 2016 15:48 UTC
@SarthakAdhikari let me take a look
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:52 UTC
ok
Richard-Bowen
@Richard-Bowen
May 29 2016 15:53 UTC
Hello all, Can someone take a look at my code and tell me why it's misbehaving. The div coloring is off by 1. Can't seem to find out why... Thanks
Shivam
@shvbzt8
May 29 2016 15:54 UTC
Hello everybody, can someone tell me how to create navigation bar using bootstrap
SarthakAdhikari
@SarthakAdhikari
May 29 2016 15:55 UTC
@shvbzt8 There is an amazing w3school tutorial on that :)
Shivam
@shvbzt8
May 29 2016 15:57 UTC
Ok thanks
here
Sorin Ruse
@sorinr
May 29 2016 16:00 UTC
@Richard-Bowen you have a border radius of 5px on class .results div
Senatrius
@Senatrius
May 29 2016 16:02 UTC
Hi all. I've been working on the tribute page. Any feedback is appreciated, it has been one of my first run ins with bootstrap so im not quite sure how the rows and columns work. https://codepen.io/Senatrius/pen/wWvoRq
Richard-Bowen
@Richard-Bowen
May 29 2016 16:04 UTC
@sorinr why would that make the coloring of the top div go down to the next ?
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:06 UTC
@jwoo92 Thanks :D
CamperBot
@camperbot
May 29 2016 16:06 UTC
sarthakadhikari sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:cookie: 335 | @jwoo92 |http://www.freecodecamp.com/jwoo92
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:06 UTC
Exactly something I was looking for.
Sorin Ruse
@sorinr
May 29 2016 16:07 UTC
@Richard-Bowen i thought you mean the white pixels left and right between divs . i think i understand what you mean. your ul has a margin before and after of 1em as i see
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:08 UTC
Incase anyone needs motivation :) https://www.youtube.com/watch?v=mk48xRzuNvA
Justin Woodward
@jwoo92
May 29 2016 16:08 UTC
@SarthakAdhikari no problem.
@SarthakAdhikari do you have the code you need? i am going to remove it from my copepen now.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:09 UTC
@jwoo92 Which part of the curriculum are you working on? :)
@jwoo92 Wait.
I've forked it.
:_
:)
Justin Woodward
@jwoo92
May 29 2016 16:12 UTC
@SarthakAdhikari i am on the intermediate algorithm challenges. i added/changed a little around on your html and css as well. also you may like this motivational video in response to what you posted :) https://www.youtube.com/watch?v=ja-n5qUNRi8
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:14 UTC
@jwoo92 I'll check this right now. Thanks :D
CamperBot
@camperbot
May 29 2016 16:14 UTC
sarthakadhikari sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:warning: sarthakadhikari already gave jwoo92 points
Shivam
@shvbzt8
May 29 2016 16:14 UTC
Ok i have a question. Do you all look into projects code.cause I look into project code just to know from where to start.is it a good practice.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:19 UTC
@shvbzt8 I did at first.
I thought I could never do the things related to API.
Then I saw the code which confused me even more.
Richard-Bowen
@Richard-Bowen
May 29 2016 16:20 UTC
I think you should try first and then if you get really stuck, look at how other people did it. You get some good idea's from reading other peoples code but only after you have tried yourself.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:21 UTC
Then I broke the problem in steps. And started analyzing each step and started learning things that would help me solve one particular step. After all steps were solved, I combined it all together and I then had a functional project :)
Brad cox
@bravo1c
May 29 2016 16:21 UTC
hi guys, i'm stuck on creating my profolio page and need some help with moving a codepen link on my page. any ideas on how to make it move, i have tryed margin moving it but it doesnt respond.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:22 UTC
@bravo1c moving? :)
Brad cox
@bravo1c
May 29 2016 16:22 UTC
sorry adjusting the element
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:22 UTC
@bravo1c try this.. put the link within <p> and use margin or text-align
Brad cox
@bravo1c
May 29 2016 16:23 UTC
@SarthakAdhikari thanks i willl give this a go and let you know if this work s
CamperBot
@camperbot
May 29 2016 16:23 UTC
bravo1c sends brownie points to @sarthakadhikari :sparkles: :thumbsup: :sparkles:
:cookie: 345 | @sarthakadhikari |http://www.freecodecamp.com/sarthakadhikari
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:23 UTC
like <p><a href='blah blah'></a></p> and on the css part p{margin-left:45%;}
@bravo1c did that work?
Brad cox
@bravo1c
May 29 2016 16:33 UTC
@SarthakAdhikari nope, god this is annoying, i have no idea how to sort this out.
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:34 UTC
@bravo1c I can help if you send me the link :)
greg
@wearenotgroot
May 29 2016 16:36 UTC
@SarthakAdhikari ------------>http://codepen.io/Bravo1c/pen/KMKmwm
Brad cox
@bravo1c
May 29 2016 16:37 UTC
@SarthakAdhikari no problem i will sent it over now, please dont pay attetoion to it to much as its not anywhere near done
@wearenotgroot i was on it lol
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:38 UTC
so what is the problem?
Brad cox
@bravo1c
May 29 2016 16:38 UTC
i want to alian the codepen link with the center if the page with the content as it isnt and i cant get it too
@SarthakAdhikari just fixed it. all i needed was to put a closing div on the portfilo header
Lisa
@aGirlWhoCodes
May 29 2016 16:42 UTC
HEllo Everyone! I wrote some code for the Twitch stream project.. I am not struck at the point that only the last channel from my array of channels wants to print out on the screen.. How can I make all the channels print out? http://codepen.io/Didi987/pen/BzBpwq
Brad cox
@bravo1c
May 29 2016 16:42 UTC
@SarthakAdhikari thanks for your help no the less, i love this community
CamperBot
@camperbot
May 29 2016 16:42 UTC
bravo1c sends brownie points to @sarthakadhikari :sparkles: :thumbsup: :sparkles:
:warning: bravo1c already gave sarthakadhikari points
greg
@wearenotgroot
May 29 2016 16:43 UTC
@aGirlWhoCodes probably need to append them
@aGirlWhoCodes -------->
$('#results').append(results);
SarthakAdhikari
@SarthakAdhikari
May 29 2016 16:44 UTC
@bravo1c Well, great :D I was having a very bad connection. i couldn't help.
Lisa
@aGirlWhoCodes
May 29 2016 16:45 UTC
@wearenotgroot That's funny. If I append it's only printing the last channel but then 8 times (that's how far the loop goes).
greg
@wearenotgroot
May 29 2016 16:45 UTC
@aGirlWhoCodes also to determine if an account is closed, you should watch out for the error code 422
Lisa
@aGirlWhoCodes
May 29 2016 16:46 UTC
is that the same as undefined? @wearenotgroot
greg
@wearenotgroot
May 29 2016 16:46 UTC
@aGirlWhoCodes nope
Lisa
@aGirlWhoCodes
May 29 2016 16:46 UTC
bcz I did it like this: els if (data.stream === undefined)
Brad cox
@bravo1c
May 29 2016 16:47 UTC
@SarthakAdhikari No problem buddy
Lisa
@aGirlWhoCodes
May 29 2016 16:47 UTC
how do I write error code 422?
greg
@wearenotgroot
May 29 2016 16:47 UTC
@aGirlWhoCodes ----------->http://api.twitch.tv/kraken/streams/ only give you channels that are streaming
Lisa
@aGirlWhoCodes
May 29 2016 16:48 UTC
Ok that's what I am using
greg
@wearenotgroot
May 29 2016 16:48 UTC
@aGirlWhoCodes ---------->http://api.twitch.tv/kraken/channel/ will give you info of any channel however will not tell you if they are online streaming
@aGirlWhoCodes you need to add a function/callback for the error the $.getJSON returns
Lisa
@aGirlWhoCodes
May 29 2016 16:50 UTC
@wearenotgroot thanks i will review all that
CamperBot
@camperbot
May 29 2016 16:50 UTC
agirlwhocodes sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1062 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
yerevin
@yerevin
May 29 2016 16:58 UTC
hi how to solve this problem with gaining game finished?
http://codepen.io/sirmmate/pen/RRwggg/?editors=0010
its like i'm having alert after every click
Nguyễn Quốc Đại
@nqdai1992
May 29 2016 17:07 UTC
hi every one. I have a problem. I don't know to modify button in a div by css. Anyone can guide me ? Thanks
That my code
http://codepen.io/dainguyen1992/pen/gMYmgJ
yerevin
@yerevin
May 29 2016 17:15 UTC
u dont have any button in ur code
@nqdai1992 u must make first button to use him in jquery, like
<button id="button" class="btnclick"></button>
Bruce Young
@mutantspore
May 29 2016 17:27 UTC
@aGirlWhoCodes I don’t know if you’ve solved your issue but this is a fork of your pen posted earlier
http://codepen.io/MutantSpore/pen/MeWQXX?editors=1010
the api call has to be https and I’ve replaced your for loop with a .forEach loop. That way it will send off a function with a api request for each of the channels rather than race thoufgh your loop and really just do the last one.
@aGirlWhoCodes and as pointed out by others you’ll end up doing 2 api calls to get all the required info
Christopher Henry
@chenry001
May 29 2016 17:58 UTC

Hi all.
Two part question here (re: Tribute project)... trying to select even # child elements of a div (by id) with jQuery -->

$("#my-div:even").css("font-family", "symbol");

<div id="my-div">
    <p>Some text I want to apply a font to</p>
    <p>Don't apply font to this text though</p>
    <br>
    <p>Some text I want to apply a font to</p>
    <p>Don't apply font to this text though</p>
</div>

My test font 'symbol' is getting applied to all of the p elements of "my-div", not just even ones. What am I doing wrong?
Theory so far is that my current jQuery code is targeting every even #my-div - which makes sense, so how would i target even elements OF #my-div?

Part 2:

The other problem (I think) is that the <br> makes it so that applying to even elements doesnt really work out right.

What I really need to do is something I IMAGINE might look like this below (which actually seems to break jQuery completely in my html page!):
$("#my-div").p:nth-of-type(even).css("font-family", "symbol");
i.e. select even child elements of type <p> for id="my-div" and apply css to them.

I have looked at nth-of-type information online, but I don't think I see how to construct the instruction I want properly (plus, since I can't even get the simple 'even' selector to work yet...)

Joseph Padgett
@Jspadgett82
May 29 2016 18:03 UTC
@chenry001 For the first part, have you tried $("#my-div:nth-child(even)”)?
Christopher Henry
@chenry001
May 29 2016 18:03 UTC
i don't think so... will now, thanks.
Does not work (for me). I tried $("#my-div:nth-child(1)") as well, no font was applied to any child in either case.
@Jspadgett82 Thanks though. Will keep staring at this.
CamperBot
@camperbot
May 29 2016 18:08 UTC
chenry001 sends brownie points to @jspadgett82 :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @jspadgett82 |http://www.freecodecamp.com/jspadgett82
Joseph Padgett
@Jspadgett82
May 29 2016 18:09 UTC
@chenry001 Huh, alright. I haven’t delved too much into using that. I was just checking some documentation to see about it. Lemme try something and get back to you if no one else answers before then.
Christopher Henry
@chenry001
May 29 2016 18:12 UTC
Thanks again. I did just get this to work: $("p:nth-child(even)").css("font-family", "symbol"); I.e. targeting even <p> elements in through the entire doc. Not acceptable, but at least something worked :-)
Joseph Padgett
@Jspadgett82
May 29 2016 18:14 UTC
@chenry001 Ahhhh yeah, I see what you did there. Literally. Temp solution at least, eh?
Christopher Henry
@chenry001
May 29 2016 18:15 UTC
hehe, i guess it could be a temp solution. but will i ever come back?
Joseph Padgett
@Jspadgett82
May 29 2016 18:16 UTC
To that? Maybe not. But something to keep in mind at least so you can figure out how to get it done for future reference if you get the thought to.
Christopher Henry
@chenry001
May 29 2016 18:20 UTC
the problem actually is that my font is getting applied to a <p> that should not get it. I might be able to override on that <p> with jQuery too, but that's pretty darn messy. I should probably at that point just apply inline to each <p> or add a class to the <p>'s i want to apply the font to. Which leaves me not knowing how to actually utilize these child things still. Catch-22 ish.
trying google again, different search terms. thanks again.
Joseph Padgett
@Jspadgett82
May 29 2016 18:21 UTC
@chenry001 No problem. If I knew more about using child and parent beyond the FCC exercises, I’d suggest other things lol. Good luck!
Christopher Henry
@chenry001
May 29 2016 18:22 UTC
ty
Joseph Padgett
@Jspadgett82
May 29 2016 18:25 UTC

Alright folks. Here’s where I’m at on my quote generator:
http://codepen.io/Jspadgett82/pen/ONvxjG
I’m almost done, at least with the base code so far. I understand what I’ve got so far, (luckily, go me) but I am having trouble getting this tweet button to put the generated quote into a twitter widget. The way I have this written, it’s writing not a number, and if I put it with just randomIndex it writes the number of the array index instead of the words I want it to.

 $('#tweetbutton').attr('href', 'https://twitter.com/intent/tweet?text='+ (randomIndex[quotation.quote] + randomIndex[quotation.author])).attr('target', '_blank’);

Can anyone give me some advice or direction on how to change that to make it put the quote and author in the tweet box?

Bruce Young
@mutantspore
May 29 2016 18:32 UTC
@Jspadgett82 you already have created the quotation.quote & quotation.author . just plug them in , no need to try to do it again
$('#tweetbutton').attr('href', 'https://twitter.com/intent/tweet?text='+ quotation.quote + quotation.author).attr('target', '_blank’);
Joseph Padgett
@Jspadgett82
May 29 2016 18:34 UTC
@mutantspore Oh geez, tysm. Always the overlooked stuff v.v
Christopher Henry
@chenry001
May 29 2016 18:37 UTC
woohoo! Solved both parts of my question:
$("#my-div p:nth-child(even)".css("font-family", "symbol");
Joseph Padgett
@Jspadgett82
May 29 2016 18:39 UTC
@chenry001 lol awesome. I would have never thought it would let you put a space between my-div and p in that.
Christopher Henry
@chenry001
May 29 2016 18:40 UTC
me either. just happened to look at the right search result. in fact you can do more that one space! here is the example i looked at:
$('#tasklist ul li div:nth-child(2)')
Bruce Young
@mutantspore
May 29 2016 18:40 UTC
@Jspadgett82 now if you also put randomQuote(); inside your doc ready function it will pull in a quote on page load
Joseph Padgett
@Jspadgett82
May 29 2016 18:41 UTC
@mutantspore Ohhhhh, didn’t think of that. (obviously) Thank you for that, cause that would be preferable. Going to add that now lol
CamperBot
@camperbot
May 29 2016 18:41 UTC
jspadgett82 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1651 | @mutantspore |http://www.freecodecamp.com/mutantspore
Joseph Padgett
@Jspadgett82
May 29 2016 18:42 UTC
@mutantspore Okay, I just did, put it above the reset button click. Does it matter if it’s above or below that?
Bruce Young
@mutantspore
May 29 2016 18:43 UTC
@Jspadgett82 no that’s all good. the other only works if it’s clicked anyway.
Joseph Padgett
@Jspadgett82
May 29 2016 18:44 UTC
@mutantspore Ahhh, awesome. Just didn’t know if it was a thing that followed the reads from top to bottom like not putting all your js script above your html for faster page loading, etc..
Bruce Young
@mutantspore
May 29 2016 18:45 UTC
nothing’s going to happen until doc ready fires
Karlo Mirkovic
@respectTheGrind
May 29 2016 18:46 UTC
http://codepen.io/respectTheGrind/pen/rLNeXb
Hello guys, I'm on the personal portfolio project, and I can't seem to figure out how to remove the white bar in between the navbar and the <div> with the "about" <h1> tag.
Joseph Padgett
@Jspadgett82
May 29 2016 18:46 UTC
@mutantspore Alrighty. Thank you so much again. What you pointed out pretty much is what I end up doing on these things I dive head first into with no prior experience. Always over thinking and/or using way too much code and not realizing it until after the fact. That one was stumping me for a while haha
CamperBot
@camperbot
May 29 2016 18:46 UTC
jspadgett82 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: jspadgett82 already gave mutantspore points
Joseph Padgett
@Jspadgett82
May 29 2016 18:53 UTC
@respectTheGrind You talking about the space between the black and the grey? Just making sure I’m looking at what you’re talking about.
Karlo Mirkovic
@respectTheGrind
May 29 2016 18:53 UTC
@Jspadgett82 yeah
@Jspadgett82 I don't want the whole page to be gray, I want it exactly as it is but without the white space between the black navbar and the grey div
Joseph Padgett
@Jspadgett82
May 29 2016 18:56 UTC
@respectTheGrind I don’t know if there’s an easy dynamic fix, but you can set your css to be margin-top:-20px; on your #about
Bruce Young
@mutantspore
May 29 2016 18:56 UTC
@respectTheGrind
.navbar {
  margin-bottom: 0px !important;
}
Joseph Padgett
@Jspadgett82
May 29 2016 18:57 UTC
@respectTheGrind Or that, heh
Karlo Mirkovic
@respectTheGrind
May 29 2016 18:57 UTC
@mutantspore @Jspadgett82 Thank you guys for your help.
CamperBot
@camperbot
May 29 2016 18:57 UTC
respectthegrind sends brownie points to @mutantspore and @jspadgett82 :sparkles: :thumbsup: :sparkles:
:cookie: 300 | @jspadgett82 |http://www.freecodecamp.com/jspadgett82
:star2: 1652 | @mutantspore |http://www.freecodecamp.com/mutantspore
Aryan
@aryandua
May 29 2016 18:59 UTC
Hey guys
What is wrong with my code it doesnt seem to work
matthew3454
@matthew3454
May 29 2016 19:14 UTC
Did anyone use a geolocation code for determining your location on the "Show me the Weather" application or did you just use latitude and longitude?
Bruce Young
@mutantspore
May 29 2016 19:14 UTC
@aryandua i don’t know but if you use the [Analyse JS] button in the JS settings in code pen you’ll see a number of things you should address first
@matthew3454 you’re having trouble with Chrome doing that?
matthew3454
@matthew3454
May 29 2016 19:15 UTC
@mutantspore you called it
Bruce Young
@mutantspore
May 29 2016 19:15 UTC
@matthew3454 ok just recently Chrome required you to do geolocation using https
but
the weather api won’t work like that
so
ditch teh geolocate and use http://ip-api.com to get lat/lon
matthew3454
@matthew3454
May 29 2016 19:17 UTC
@mutantspore cool man I'll give it a go. Thanks
CamperBot
@camperbot
May 29 2016 19:17 UTC
matthew3454 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1653 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
May 29 2016 19:17 UTC
the OWM weather api will need to be called as https but the free version can’t be. so keep it all http
Aryan
@aryandua
May 29 2016 19:17 UTC
@mutantspore what do you mean by that?
Bruce Young
@mutantspore
May 29 2016 19:19 UTC
@aryandua ?? your JS has errors that the button I mentioned will highlight. see what happens if you fix those errors first
Aryan
@aryandua
May 29 2016 19:19 UTC
ok
matthew3454
@matthew3454
May 29 2016 19:19 UTC
@mutantspore gotcha
Bruce Young
@mutantspore
May 29 2016 19:19 UTC
@aryandua it’s the jsHint
Aryan
@aryandua
May 29 2016 19:20 UTC
huh?
what is that?
Bruce Young
@mutantspore
May 29 2016 19:20 UTC
@aryandua @aryandua @aryandua @aryandua @aryandua @aryandua open the JS cog in codepen
Aryan
@aryandua
May 29 2016 19:21 UTC
what is cog?
Bruce Young
@mutantspore
May 29 2016 19:21 UTC
look for the Analyse JS button at the bottom of that modal
Aryan
@aryandua
May 29 2016 19:22 UTC
I dont see it
Bruce Young
@mutantspore
May 29 2016 19:22 UTC
down under were you added jquery
Screen Shot 2016-05-29 at 3.22.26 PM.png
Aryan
@aryandua
May 29 2016 19:22 UTC
oh ok
i See it
fixing errors
Bruce Young
@mutantspore
May 29 2016 19:26 UTC
@aryandua you also have x as x rather than as “X” when you are checking for wins etc.
Aryan
@aryandua
May 29 2016 19:28 UTC
@mutantspore look at the declartion of x
var x=prompt("PICK X OR O");
Bruce Young
@mutantspore
May 29 2016 19:28 UTC
yes.. so later you are comparing that to what?
Aryan
@aryandua
May 29 2016 19:29 UTC
example-
 if(arr[0][0]===arr[1][1]===arr[2][2]===x||
    arr[0][2]===arr[1][1]===arr[2][0]===x) {
  alert("X WINS!");
  }
Bruce Young
@mutantspore
May 29 2016 19:29 UTC
you have “O” in the O wins
Aryan
@aryandua
May 29 2016 19:29 UTC
oh!
you are right @mutantspore
first I was displaying you win or you lose
now I am doing O wins or X wins
so I forgot to switch that
:)
fixed all errors still doesnt work
elminsterrr
@elminsterrr
May 29 2016 19:33 UTC

Hi, Please test for 10 seconds my little app: https://codepen.io/elminsterrr/full/VjwXLa
I need to know if it is printing your location to HTML [MAP doesn't work]

Your location latitude: x
Your location longitude: y

Your location name: abc

Please use first button, then second to print
matthew3454
@matthew3454
May 29 2016 19:34 UTC
If helping me move forward isn't any trouble for anyone I will certainly appreciate your assistance. http://codepen.io/codeabode20/pen/PzoRzJ
Aryan
@aryandua
May 29 2016 19:34 UTC
This message was deleted
works
works for me
@mutantspore What is wrong with my code
??
Bruce Young
@mutantspore
May 29 2016 19:37 UTC
@matthew3454 you need the ip-api for getting the users location not geolocate. the weathe rapi is the open weather map. api.
http://openweathermap.org/api
Aryan
@aryandua
May 29 2016 19:37 UTC
This message was deleted
Bruce Young
@mutantspore
May 29 2016 19:38 UTC
@mutantspore yes I’m looking. I have to work out what you are trying to do..find mistakes
Aryan
@aryandua
May 29 2016 19:38 UTC
ok
Bruce Young
@mutantspore
May 29 2016 19:39 UTC
@aryandua you are concerned that it’s not assessing the win/draw/loose
?
Aryan
@aryandua
May 29 2016 19:40 UTC
yes
elminsterrr
@elminsterrr
May 29 2016 19:47 UTC
@aryandua thanks for support :smile:
CamperBot
@camperbot
May 29 2016 19:47 UTC
elminsterrr sends brownie points to @aryandua :sparkles: :thumbsup: :sparkles:
:cookie: 329 | @aryandua |http://www.freecodecamp.com/aryandua
Bennett Elder
@bennett-elder
May 29 2016 19:47 UTC
@elminsterrr I get the lat and lon but no location name (should be Jacksonville, FL)
elminsterrr
@elminsterrr
May 29 2016 19:48 UTC
@bennett-elder Did you click Show me my Location Button?
Bennett Elder
@bennett-elder
May 29 2016 19:48 UTC
I did
gives me a console error
TypeError: results1.address_components[5] is undefined
elminsterrr
@elminsterrr
May 29 2016 19:49 UTC
Okey so in your location there is something diffrent, please wait one minute I will change it
Karlo Mirkovic
@respectTheGrind
May 29 2016 19:51 UTC
hello guys
http://codepen.io/respectTheGrind/pen/rLNeXb
The buttons in the navbar link to certain sections on the page, but they just jump to that section. How do I make them scroll smoothly to the section?
Bennett Elder
@bennett-elder
May 29 2016 19:54 UTC
@respectTheGrind it looks like the easiest way will be using jQuery's animate method
elminsterrr
@elminsterrr
May 29 2016 19:55 UTC
@bennett-elder Please look at this new PEN: https://codepen.io/elminsterrr/full/NrWYvB/
is it working now?
Bennett Elder
@bennett-elder
May 29 2016 19:55 UTC
@respectTheGrind seeing a lot of good results when searching for html scroll smoothly to anchor
Bruce Young
@mutantspore
May 29 2016 19:56 UTC
@aryandua I can see what you intend but I don’t know if this sort of thing is legal or if it is ..what is it actually doing
if (arr[i][0] === arr[i][1] === arr[i][2]) {
Bennett Elder
@bennett-elder
May 29 2016 19:56 UTC
hey... cool... apparently I live in a neighborhood named Lakewood :)
@elminsterrr (y)
thumbs up
Karlo Mirkovic
@respectTheGrind
May 29 2016 19:57 UTC
@bennett-elder thanks
CamperBot
@camperbot
May 29 2016 19:57 UTC
respectthegrind sends brownie points to @bennett-elder :sparkles: :thumbsup: :sparkles:
:cookie: 242 | @bennett-elder |http://www.freecodecamp.com/bennett-elder
Bruce Young
@mutantspore
May 29 2016 19:57 UTC
@matthew3454 yes but instead of ID you need to use the lat/lon version. Are you in Cairns.. Queensland?
elminsterrr
@elminsterrr
May 29 2016 19:57 UTC
@bennett-elder It is working good now? What location name it is printing? :)
Bennett Elder
@bennett-elder
May 29 2016 19:58 UTC
@elminsterrr Your location name: Lakewood, Jacksonville, FL, USA
matthew3454
@matthew3454
May 29 2016 19:58 UTC
@mutantspore yes, I'm only about 8,000 miles to the east!
Bennett Elder
@bennett-elder
May 29 2016 19:58 UTC
^ only lol
elminsterrr
@elminsterrr
May 29 2016 19:58 UTC
@bennett-elder Yes! Thank you very much for your help. :) :+1:
CamperBot
@camperbot
May 29 2016 19:58 UTC
elminsterrr sends brownie points to @bennett-elder :sparkles: :thumbsup: :sparkles:
:cookie: 243 | @bennett-elder |http://www.freecodecamp.com/bennett-elder
Bennett Elder
@bennett-elder
May 29 2016 19:59 UTC
@respectTheGrind I'm liking the example at w3 schools the best
http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_animate_smoothscroll
matthew3454
@matthew3454
May 29 2016 19:59 UTC
@mutantspore okay I'll try again
Bruce Young
@mutantspore
May 29 2016 20:00 UTC
@matthew3454 http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139
@matthew3454 that sort of thing with the lat and lon from the ip-api
matthew3454
@matthew3454
May 29 2016 20:02 UTC
@mutantspore wow that's what is looks like okay. Thanks again.
CamperBot
@camperbot
May 29 2016 20:02 UTC
matthew3454 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: matthew3454 already gave mutantspore points
Bennett Elder
@bennett-elder
May 29 2016 20:02 UTC
@respectTheGrind it looks like once you have that small bit of javascript you can extend the example to work with any number of links http://codepen.io/bennett-elder/pen/MeWVOd
Bruce Young
@mutantspore
May 29 2016 20:03 UTC

@aryandua look at this very simple example

var x =  (5 === 5 === 5);
  console.log(x);

that prints out false to the console as I suspect that it first evaluates 5 === 5 to being true and then evaluates true === 5 giving false

Bennett Elder
@bennett-elder
May 29 2016 20:07 UTC
^ well that's a fun "gotcha"
Kim Ward
@wardy484
May 29 2016 20:12 UTC
Hey guys I'm currently on the twice challenge and I'm a bit stumped regarding how you get details of a channel that is offline. In the example there is a display picture even though the channel is offline however when I'm making the json request all I get is an object with some links and a stream of null; which tells me it's offline but doesn't enable me to do much else.
Bruce Young
@mutantspore
May 29 2016 20:13 UTC
@wardy484 you have to do 2 api calls. one to streams and one to channels to get all the info
matthew3454
@matthew3454
May 29 2016 20:16 UTC
@mutantspore I got an invalid api key when I put it in the browser. Is that a problem?
Aryan
@aryandua
May 29 2016 20:16 UTC
@mutantspore did you figure out whats wrong with my code??
matthew3454
@matthew3454
May 29 2016 20:16 UTC
I got an invalid api key wmessage hen I put it in the browser. Is that a problem?
I got an invalid api key message when I put it in the browser. Is that a problem?
Bruce Young
@mutantspore
May 29 2016 20:17 UTC
@aryandua I left several messages indicating that your if statements with multiple === aren’t doing what you want them to. you’ll need to expand that out fully
@matthew3454 the line I posted above didn’t have a key in it
@aryandua did you understand my simple example above
@matthew3454
Kim Ward
@wardy484
May 29 2016 20:20 UTC
@mutantspore awesome I wouldn't have thought of that. Thanks!
CamperBot
@camperbot
May 29 2016 20:20 UTC
wardy484 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1654 | @mutantspore |http://www.freecodecamp.com/mutantspore
Aryan
@aryandua
May 29 2016 20:20 UTC
@mutantspore thx I got it
CamperBot
@camperbot
May 29 2016 20:20 UTC
aryandua sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1655 | @mutantspore |http://www.freecodecamp.com/mutantspore
matthew3454
@matthew3454
May 29 2016 20:24 UTC
@mutantspore Okay I got it this time. thanks
CamperBot
@camperbot
May 29 2016 20:24 UTC
matthew3454 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1656 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
May 29 2016 20:24 UTC
@wardy484 I think you may need to watch this to understand asynchronous api calls and the consequences.
https://www.youtube.com/watch?v=obaSQBBWZLk
@matthew3454 ok good :)

@respectTheGrind try putting this in your JS

  // smooth scrolling of viewport to target
  $('a[href^="#"]').click(function(event) {
    event.preventDefault();
    $('html,body').animate({
      scrollTop: $(this.hash).offset().top - 50
    }, 900);
  });

to get a nice smooth scroll

Maritimesailor
@Maritimesailor
May 29 2016 20:27 UTC
Any anyone well aquanited with angularjs?
mr910 @mr910 hides
Brad
@mr910
May 29 2016 20:28 UTC
lol
I still got my rookie boots on
Bruce Young
@mutantspore
May 29 2016 20:33 UTC
@respectTheGrind http://codepen.io/MutantSpore/pen/jrOzKd
I added a little body css and the required JS and it needs jQuery . I made the navbar fixed to the top
Antony Ndungu
@Antony-Ndungu
May 29 2016 20:40 UTC
@mutantspore How did you make it scroll smoothly and slowly. I have been trying that but I have not managed to do it.
redixhumayun
@redixhumayun
May 29 2016 20:40 UTC

http://codepen.io/redixhumayun/pen/rLNzpm?editors=1111

I have no idea why the C won't disappear and be replaced by the F when I click on it. I think I have my code set up right. Any help?

Bruce Young
@mutantspore
May 29 2016 20:41 UTC
@Antony-Ndungu the pen i posted above was a fork to show someone how to do it. i put some code in JS and loaded jQuery too
Aryan
@aryandua
May 29 2016 20:43 UTC
http://codepen.io/aryandua/pen/WxNzMa?editors=1010 @mutantspore It still does not work
Antony Ndungu
@Antony-Ndungu
May 29 2016 20:44 UTC
@mutantspore cool. I am looking at it. Well done.
Aryan
@aryandua
May 29 2016 20:46 UTC
@mutantspore infact the page crashes if you play the game
Bennett Elder
@bennett-elder
May 29 2016 20:47 UTC
^
greg
@wearenotgroot
May 29 2016 20:48 UTC
@aryandua computer is too OP
:)
Aryan
@aryandua
May 29 2016 20:49 UTC
@wearenotgroot I dont get it
Tell me again
matthew3454
@matthew3454
May 29 2016 20:54 UTC
I made a few adjustments to my code in this "Show Me the Weather" app, but I still can't seem to get it to run. If anyone has an inkling to give advice that would be cool.http://codepen.io/codeabode20/pen/PzoRzJ?editors=0010
Dylan
@dhcodes
May 29 2016 20:55 UTC
@matthew3454 looks like you have some punctuation errros
lol
then i made a typo
Bruce Young
@mutantspore
May 29 2016 20:56 UTC
@matthew3454 go into the codepen settings (the JS cog) and press the Analyse JS button .. try to fix the errors then see where you are.
matthew3454
@matthew3454
May 29 2016 20:56 UTC
@mutantspore good plan
@dhcodes \
Nerando Johnson
@Nerajno
May 29 2016 20:56 UTC
ok so i complete my front end page an i know it needs help but here goes : http://codepen.io/swishswashDeadpool/full/JKjLwb/
Dylan
@dhcodes
May 29 2016 20:57 UTC
@matthew3454 i got it to load at least
forked it for you
a few things @matthew3454 you had a . after a function
matthew3454
@matthew3454
May 29 2016 20:58 UTC
@dhcodes nice man.
Dylan
@dhcodes
May 29 2016 20:58 UTC
you had bracket notation as weather.[0].
which should've been weather[0].
Aryan
@aryandua
May 29 2016 20:58 UTC
@mutantspore now what is wrong with my code
?
Dylan
@dhcodes
May 29 2016 20:58 UTC
and various mixed closing of functions
@matthew3454
Aryan
@aryandua
May 29 2016 20:59 UTC
@mutantspore Are you still there?
Bruce Young
@mutantspore
May 29 2016 21:00 UTC
@aryandua 5pm.. I have to get my wife organized for work now.
Dylan
@dhcodes
May 29 2016 21:00 UTC
@aryandua i recommend trying to troubleshoot your own code so you can ask more specific questions
why won't my code work isn't really a specific question
matthew3454
@matthew3454
May 29 2016 21:01 UTC
@dhcodes I'll will check those out. thanks
CamperBot
@camperbot
May 29 2016 21:01 UTC
matthew3454 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:cookie: 910 | @dhcodes |http://www.freecodecamp.com/dhcodes
Aryan
@aryandua
May 29 2016 21:02 UTC
@mutantspore ok bye! thx for the help
CamperBot
@camperbot
May 29 2016 21:02 UTC
aryandua sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: aryandua already gave mutantspore points
Aryan
@aryandua
May 29 2016 21:02 UTC
@dhcodes But i dont understand whats wrong with it
So i am asking what to ask so i can ask it and get an answer;
(:))
Dylan
@dhcodes
May 29 2016 21:03 UTC
what specifically is it not doing?
where does it fail?
Aryan
@aryandua
May 29 2016 21:03 UTC
the check function
Dylan
@dhcodes
May 29 2016 21:03 UTC
you can console.log test sentences all the way through your functions to find where it fails specifically
Aryan
@aryandua
May 29 2016 21:04 UTC
ok I'll do that
Dylan
@dhcodes
May 29 2016 21:04 UTC
@Nerajno you'll get better feedback on the codereview room
Nerando Johnson
@Nerajno
May 29 2016 21:04 UTC
ok
Kim Ward
@wardy484
May 29 2016 21:07 UTC
@mutantspore I think I'm okay with aSync but I'll have a look anyway. Thanks.
CamperBot
@camperbot
May 29 2016 21:07 UTC
wardy484 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: wardy484 already gave mutantspore points
Aryan
@aryandua
May 29 2016 21:09 UTC
THIS IS STUPID! UGHHH
since 4 days i have been trying to make this tic tac toe game
I have spent 16+ hours on this thing
and have rewritten the code at least 6 times
and it still doesnt work!!
Bennett Elder
@bennett-elder
May 29 2016 21:13 UTC
coding is like lifting weights... right now you're experiencing the "sore muscles" :)
Bruce Young
@mutantspore
May 29 2016 21:13 UTC
@wardy484 lol might have posted that to teh wrong person
Brad
@mr910
May 29 2016 21:13 UTC
@aryandua - take a deep breath
Kim Ward
@wardy484
May 29 2016 21:13 UTC
@mutantspore No worries; it's a weak area for me anyway :)
Brad
@mr910
May 29 2016 21:13 UTC
@aryandua - sometimes a break is need to clear the mind. Stand up and stretch your legs.
Aryan
@aryandua
May 29 2016 21:13 UTC
@mr910 I'll try
ok
Bennett Elder
@bennett-elder
May 29 2016 21:14 UTC
honestly I felt that way with a couple of things at work this week... it never completely goes away. that challenge is actually part of the fun
Aryan
@aryandua
May 29 2016 21:14 UTC
@bennett-elder If i try to leave it...
It doesnt get out of my mind
Joseph Padgett
@Jspadgett82
May 29 2016 21:14 UTC
@aryandua It’s definitely frustrating, but not stupid. That’s really not that long on some things when we’re all first learning on things that aren’t super simple and/or basic. Breaks are wonderful. Breathers and help are amazing, and in any order lol
Aryan
@aryandua
May 29 2016 21:15 UTC
@Jspadgett82 :)
ok Fresh start
Bennett Elder
@bennett-elder
May 29 2016 21:15 UTC
sometimes it helps, after a little break, to try a different area
Aryan
@aryandua
May 29 2016 21:15 UTC
I will rewrite my code
@bennett-elder I cant focus on anything else
Bennett Elder
@bennett-elder
May 29 2016 21:16 UTC
like if some front-end stuff is getting frustrating then it might be time for the git section. that's unrelated but still moving you forward
Aryan
@aryandua
May 29 2016 21:16 UTC
It keeps going through my mind
Bennett Elder
@bennett-elder
May 29 2016 21:16 UTC
just went through that section and the npm section just now... it's a nice change up
Brad
@mr910
May 29 2016 21:16 UTC
@aryandua - i know that feeling. I’m hanging out here when I should be working on a video… ##ImAddicted
Bennett Elder
@bennett-elder
May 29 2016 21:17 UTC
^
Aryan
@aryandua
May 29 2016 21:17 UTC
I am going to listen to music and hope that i will think about something other than for loops
Bennett Elder
@bennett-elder
May 29 2016 21:17 UTC
lol that. sometimes seeing questions other people post helps you wrap your head around what you're working on
Aryan
@aryandua
May 29 2016 21:18 UTC
so I should help others @bennett-elder ?
ok i'll do that
Anyone need help?
Bennett Elder
@bennett-elder
May 29 2016 21:18 UTC
we're kind of taught in school that to learn we should just go to class. incorrect. we should learn from a mentor and we should be a mentor. you have to do both sides...
Brad
@mr910
May 29 2016 21:19 UTC
@aryandua - I think @bennett-elder was trying to say just being here and seeing other questions might help you or others.
Bennett Elder
@bennett-elder
May 29 2016 21:19 UTC
because you don't force yourself to really understand something in depth until you can explain it to someone else :)
Brad
@mr910
May 29 2016 21:19 UTC
Ahh
Joseph Padgett
@Jspadgett82
May 29 2016 21:19 UTC
@bennett-elder Pay it forward!
Brad
@mr910
May 29 2016 21:19 UTC
@bennett-elder - appreciate the clarity on that
Aryan
@aryandua
May 29 2016 21:19 UTC
@bennett-elder makes sense
Brad
@mr910
May 29 2016 21:19 UTC
@bennett-elder - VALID point made sir!
Bruce Young
@mutantspore
May 29 2016 21:19 UTC
@bennett-elder yes.. can you explain it to someone on a bus? that’s the test.
Bennett Elder
@bennett-elder
May 29 2016 21:20 UTC
@mutantspore lol that's the best test for an elevator pitch for a startup too. can you explain it to grandma why it matters in just a few sentences...
Joseph Padgett
@Jspadgett82
May 29 2016 21:21 UTC
@bennett-elder Only if I know what it does, and think it matter, hah!
Aryan
@aryandua
May 29 2016 21:21 UTC
Challenge: you have 30 seconds to explain --for loops-- to a random stranger with no knowledge of any computer prgramming
3..
CamperBot
@camperbot
May 29 2016 21:21 UTC

:point_right: challenge bring your javascript slot machine to life [wiki]

Challenge Bring your JavaScript Slot Machine to Life

Let's use the jQuery selector $(".slot") to select all of the slots.

Once they are all selected, we can use bracket notation to access each individual slot:

$($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);

:pencil: read more about challenge bring your javascript slot machine to life on the FCC Wiki

Aryan
@aryandua
May 29 2016 21:21 UTC
2..
1..
GO!
Bennett Elder
@bennett-elder
May 29 2016 21:22 UTC
For loops... have you ever needed to do something more than once?
That's what a loop is
Aryan
@aryandua
May 29 2016 21:22 UTC
@bennett-elder Well Done!
You win!
And your prize is...
absolutely nothing
!
i have nothing to give you lol
Bennett Elder
@bennett-elder
May 29 2016 21:23 UTC
Had that conversation with my great-grandfather back in the 90s... as a carpenter he was pretty excited when I showed him you could just repeat a pattern on a page... or using a machine that would do woodwork or metalwork
then you can elaborate on two different kinds of loops you would have... one you just move through a list of things... the other one you're using the number of go around (iteration) to do something
which if you think about it is an awful lot like numbered lists versus bulleted lists
Aryan
@aryandua
May 29 2016 21:24 UTC
while(1) {
axe.postion++;
}
console.log(wood-cut);
CONSOLE_
TRUE
This message was deleted
;P
matthew3454
@matthew3454
May 29 2016 22:16 UTC
I made some more adjustments to my code for the Weather App after looking at some of the errors however. I'm not quite sure how to fix most of the other errors that are mentioned after analyzing the JS. If someone can take another look at it that would help. Thanks again.http://codepen.io/codeabode20/pen/pboVEJ?editors=0010
for example: 'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option). (Google it)
Expected an identifier and instead saw ')'. (Google it) are two of the errors I'm not quite sure about how to fix.
Here are some more errors that I have: Expected an identifier and instead saw '.'. (Google it)
Expected ')' and instead saw 'toFixed'. (Google it)
Bad invocation. (Google it)
Missing semicolon. (Google it)
Expected an identifier and instead saw ')'. (Google it)
matthew3454
@matthew3454
May 29 2016 22:39 UTC
These errors I especially don't really understand: Here are some more errors that I have: Expected an identifier and instead saw '.'. (Google it)
Expected ')' and instead saw 'toFixed'. (Google it)
Bad invocation. (Google it)
Bruce Young
@mutantspore
May 29 2016 23:11 UTC
@matthew3454 @matthew3454 working through it all
Bennett Elder
@bennett-elder
May 29 2016 23:15 UTC
btw @matthew3454 when I tried to use full page view on your pen...
"The owner of this Pen needs to verify their email address to enable Full Page View."
Brad
@mr910
May 29 2016 23:22 UTC
@bennett-elder - can you joing NonprofitProjects?? Someone has a question that might be up your alley
they’re looking for non-profits that need help
Tyler Collins
@tjscollins
May 29 2016 23:24 UTC
Trying to figure out the json API call for the weather app. For some reason the API call fails everytime, but if I put the api directly into my browser the data pops right up. https://codepen.io/tjscollins/pen/VjwxYy?editors=1011
Any ideas? I can't see anything wrong with it compared to the examples I've seen.
Bruce Young
@mutantspore
May 29 2016 23:26 UTC
@matthew3454 http://codepen.io/MutantSpore/pen/aZbGyy?editors=1010
you need to change the .css for the icon bit to .attr and put the icon url in the source of an image rather than that background image thing you had.
Bruce Young
@mutantspore
May 29 2016 23:32 UTC
@tjscollins you using Chrome?
Tyler Collins
@tjscollins
May 29 2016 23:32 UTC
Yes
Bruce Young
@mutantspore
May 29 2016 23:33 UTC
@tjscollins ok long story….
to get geolocation to work in chrome you need to access your pen using https .. you are.
BUT
you cannot then access the weather api using http. that’s dragging in insecure info into a secure site
so
you either find a https based weather api
or ditch geolocate and use http://ip-api.com for your location and use http to access your pen
@tjscollins is that understandable?
the OWM api can only be used as http for free. if you pay you can use https
Tyler Collins
@tjscollins
May 29 2016 23:37 UTC
@mutantspore Yup, makes sense. I'm just laughing at myself after it took me twenty minutes to figure out I needed https for geolocate and now I have to drop it altogether. Thanks for the help
CamperBot
@camperbot
May 29 2016 23:37 UTC
tjscollins sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1658 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
May 29 2016 23:38 UTC
@tjscollins you are also using the forecast endpoint for the api .. you should use the weather endpoint unless you want to do a 3-5 day forecast
plus your api key
Marek Slabicki
@thaniri
May 29 2016 23:52 UTC
hey can anyone check out this css border for me? http://thaniri.github.io/weatherApp/weatherApp.html
Tyler Collins
@tjscollins
May 29 2016 23:52 UTC
@mutantspore So, I switched it to ip-api, and now it works fine in Firefox, but still not in chrome: http://codepen.io/tjscollins/pen/VjwxYy?editors=1011
needed a callback on the ip one
Tyler Collins
@tjscollins
May 29 2016 23:57 UTC
@mutantspore Still doesn't work. Both API calls fail in Chrome.
@mutantspore But both work in Firefox.
Bruce Young
@mutantspore
May 29 2016 23:58 UTC
@tjscollins the link to my fork of your pen works in Safari and chrome on a Mac
redixhumayun
@redixhumayun
May 29 2016 23:58 UTC

http://codepen.io/redixhumayun/pen/rLNzpm?editors=1111

Hey, can anybody help me out with why my C button won't be hidden after I click on it? I have the following code for that

$(".letter").on("click", function(){
var final_temp = changeTemp();
$(".number").html(final_temp);
if((".letter").css('display') !='none' &&(".letter").css('display') === 'inline-block'){
$(".letter").hide();
$(".letter2").show();

Bruce Young
@mutantspore
May 29 2016 23:58 UTC
@tjscollins do you have some sort of blocking extension?
redixhumayun
@redixhumayun
May 29 2016 23:59 UTC
I'm trying to get the C button to be hidden and the F button to show up. The F button currently has a setting of display:none
Tyler Collins
@tjscollins
May 29 2016 23:59 UTC
@mutantspore Adblock is paused at the moment, but it must be something like that, because your version fails on mine too. I'll start deactivating extensions until I find the culprit.