These are chat archives for FreeCodeCamp/HelpFrontEnd

7th
Apr 2016
Jacob
@Ajacmac
Apr 07 2016 00:01
I tried that but it didn't want to behave. I figured it out though, I was just using ".class" in the css, but it needed to be "element.class"
Pawan
@pawan92
Apr 07 2016 00:09
whats up everyone so trying to get my wiki viewer done and i need a pointer as to how to break up all the results i get into link headers and short previews. can anyone point me in correct direction : http://codepen.io/pawan92/pen/zqzWYB
Alex Coder
@jkid314159
Apr 07 2016 00:14
Hello World!
CamperBot
@camperbot
Apr 07 2016 00:14

welcome to FreeCodeCamp @jkid314159!

Alex Coder
@jkid314159
Apr 07 2016 00:15
This button collapse not working?
   <button type="button" id="collapse" class="btn btn-danger" data-toggle="collapse" data-target="#disclaimer">DISCLAIMER</button>
  <div id="disclaimer" class="collapse">Activities for educational purposes. I am teaching my self to code Front End of Website.
  </div>
random-x
@random-x
Apr 07 2016 00:17
@jkid314159 #disclaimer should have class collapsed not collapse
I think. lemme test
Alex Coder
@jkid314159
Apr 07 2016 00:18
@random-x does not seem to work???
random-x
@random-x
Apr 07 2016 00:19
yeah I am wrong. haha.. 1 moment :)
@random-x I'm wrong too
my reference
@random-x thank you anyway.
CamperBot
@camperbot
Apr 07 2016 00:21
jkid314159 sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:star: 115 | @random-x | http://www.freecodecamp.com/random-x
random-x
@random-x
Apr 07 2016 00:24
@jkid314159 it seems to require the bootstrap transitions.js and collapse.js plugins
Alex Coder
@jkid314159
Apr 07 2016 00:24
@random-x do not know how to add???
ehekatlOf
@ehekatlOf
Apr 07 2016 00:31
@pawan92 check your console.log
your api call is returning as a nested array instead of an object
Alex Coder
@jkid314159
Apr 07 2016 00:31
@ehekatlOf it is in codepne
ehekatlOf
@ehekatlOf
Apr 07 2016 00:32
try to mess around with the api call parameters
random-x
@random-x
Apr 07 2016 00:39
@jkid314159 in codepen, you need to include jquery and bootstrap.js (in that order)
@jkid314159 then the default test from Bootstrap should work:
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
  Button with data-target
</button>
<div class="collapse" id="collapseExample">
  <div class="well">
    ...
  </div>
</div>
Igor Amelichev
@igoramelichev
Apr 07 2016 00:49
Hey guys, I'm working on my portfolio and trying to figure out how to navigate to different sections of the webpage by clicking buttons in the navigation bar. How do I do that?
Alex Coder
@jkid314159
Apr 07 2016 00:51
@random-x did not have bootstrap.js that did the trick
@random-x thank you.
CamperBot
@camperbot
Apr 07 2016 00:52
jkid314159 sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:warning: jkid314159 already gave random-x points
Miguel T Rivera
@mtrivera
Apr 07 2016 01:00
I'm trying to setup a localhost with Node to develop the Random Quote Machine (Not a fan of codepen).
Anyone have links on how to do this? I have node installed already .
abtak mustapha
@mustapha88
Apr 07 2016 01:01
hello
some here for help somle css
some one here for css help
Jason Arnold
@thejasonfile
Apr 07 2016 01:14
Starting the wikipedia viewer project... can someone point me to a resource that explains what the "No 'Access-Control-Allow-Origin'" error is and how to get around it... thanks.
I've been trying to figure out what that means, but it's all over my head...
Pawan
@pawan92
Apr 07 2016 01:18
@ehekatlOf yea how do i fix that?
Liz
@erbastian
Apr 07 2016 01:25
has anybody completed the twitchtv app using twitch-js-sdk instead of JSONP?
@thejasonfile unfortunately I think the only workaround there is to use JSONP. Those calls do a pre-flight call which checks the server to see if it has a specific header set.
@thejasonfile and it's not set on wikipedia's servers so for me, I couldn't figure out a way around it other than JSONP
@thejasonfile to learn more about the Access-Control-Allow-Origin error, google CORS or Cross Origin Resource Sharing
Jason Arnold
@thejasonfile
Apr 07 2016 01:33
@erbastian okay, I'll start looking there. thanks!
CamperBot
@camperbot
Apr 07 2016 01:33
thejasonfile sends brownie points to @erbastian :sparkles: :thumbsup: :sparkles:
:star: 283 | @erbastian | http://www.freecodecamp.com/erbastian
Liz
@erbastian
Apr 07 2016 01:34
sure thing
Igor Amelichev
@igoramelichev
Apr 07 2016 01:54
Can anyone point me to or explain how to navigate/ scroll through the portfolio page challenge?
Michael Aubrey
@mca62511
Apr 07 2016 02:18
@igoramelichev what do you mean?
ehekatlOf
@ehekatlOf
Apr 07 2016 02:24
anybody have experience working with jquery mobile?
for page transitions I mean
Solomon Barayev
@sbarayev
Apr 07 2016 02:36
guys maybe you can help just my own little project, can't seem to get a function to work, in short, when i click on a box (as seen from boxes event listener) all the notes play instead of just the corresponding index in the notes array...
var h1 = document.querySelector("h1");
var boxes = document.querySelectorAll(".box");
var notes = document.querySelectorAll(".audio");


function playBoxes(){
    for(i=0; i<boxes.length; i++){
        boxes[i].addEventListener("click", function(){
            for(j = 0; j < notes.length; j++){
                if(i = j){
                    notes[i].currentTime = 0;
                    notes[i].play();
                }
            }
        });
    }
}

playBoxes();
Solomon Barayev
@sbarayev
Apr 07 2016 02:44
nobody?...
Ken Haduch
@khaduch
Apr 07 2016 02:53
@sbarayev - there is a problem with doing things this way. You are declaring a number of different functions... wait, I see two problems at least, maybe one is more significant than the other.
  • your test (or what looks like a test) if ( i = j ) is not correct. You want to do either i == j or i === j if you are comparing values. That might be the problem?
  • the second thing that I think is the problem for real is that you are creating a number of anonymous functions for click handlers. Each of those functions references the variable i. When you declare functions like this, the value of i is a 'global' to each of them, and the problem is that after the for loop creates these functions, each function sees the same 'final' value of i. If you want to prove this, put a console.log statement in there and have it print the value of i and see if that isn't the case?
@sbarayev - without having the full code to look at, those are my best guesses...
Richard
@richao03
Apr 07 2016 03:35
any html/jquery wizards here?
i need help with a search box
i want the user to be able to enter a zip code which i then feed to an api URL
Jeff
@adzam5
Apr 07 2016 03:41
@richao03 Which part do you need help with?
Richard
@richao03
Apr 07 2016 03:42
i have a search box set up
but i dont know how to get the value from the box once someone enters it
Jeff
@adzam5
Apr 07 2016 03:43
@richao03 You can use something like var value = $('#mySearchBox').val();
Richard
@richao03
Apr 07 2016 03:45
hmmm i tried that
... i think its because i set it to clicking the icon but the clicking isnt working
ehekatlOf
@ehekatlOf
Apr 07 2016 03:45
alright, I think I'm done with this
any thoughts before I send it?
also what framework is normally used for page transition animations
Michael Karpinski
@karpimpski
Apr 07 2016 03:52
@ehekatlOf looks great! also looks like you did this project after a lot of other FCC projects
ehekatlOf
@ehekatlOf
Apr 07 2016 03:53
I did haha
I wanted to do the portfolio last
because otherwise what would I put in the portfolio?
Sam
@Samwise12
Apr 07 2016 03:55
fill.style.height = 22; why does this stop all my functions from running?
Jeff
@adzam5
Apr 07 2016 03:58
@richao03 Can you share your code?
Collin Perkins
@Tallfreak
Apr 07 2016 04:00
I used this
For mine i used this. http://jsbin.com/favubeyiki/5/edit?html,output
var headerHeight = $("div.navbar-header").height();
$(function() {
  $('a[href*="#"]:not([href="#"])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html, body').animate({
          scrollTop: target.offset().top - headerHeight
        }, 500);
        return false;
      }
    }
  });
});
CamperBot
@camperbot
Apr 07 2016 04:03
:bulb: to format code use backticks! ``` more info
ehekatlOf
@ehekatlOf
Apr 07 2016 04:03
hey that one's new
pretty useful
Elbert Cortez
@trip16661
Apr 07 2016 04:04
Paul Ballardin
@outsmart
Apr 07 2016 04:05
Hey all, anyone have any luck with the Wikipedia viewer
Mike Moss
@MMux
Apr 07 2016 04:08
@outsmart where are you at with it?
random-x
@random-x
Apr 07 2016 04:09
@trip16661 the most confusing part for me was that the arrows are "more from the same author" and since your default is "Me." there are no more from the same author
Elbert Cortez
@trip16661
Apr 07 2016 04:09
y
i guess i need to make it a random since start
Michael Karpinski
@karpimpski
Apr 07 2016 04:10
@trip16661 functionality seems fine, but in your HTML you use a Bootstrap class, but you don't have bootstrap included in your CSS
might want to add Bootstrap
random-x
@random-x
Apr 07 2016 04:10
@trip16661 also.. I found a bug :(
Elbert Cortez
@trip16661
Apr 07 2016 04:10
what it is?
Paul Ballardin
@outsmart
Apr 07 2016 04:10
hey @MMux I have walked away from it so many times because I keep getting an error in codepen that I cannpot use an external API.
@MMux I am about to start again now from scratch
random-x
@random-x
Apr 07 2016 04:11
@trip16661 to recreate the bug:
  1. search for a name (e.g., Buddha)
  2. click Random
  3. hit > arrow
  4. the quote is still from the searched-for author, but it shows the Random author's name
s/original/searched-for/
Elbert Cortez
@trip16661
Apr 07 2016 04:11
@karpimpski y well the html is really temporal i just did it quicly and took some
Michael Karpinski
@karpimpski
Apr 07 2016 04:12
@trip16661 oh i know. just for future reference when you design it, make sure you add bootstrap. it just seemed like you missed it, since you added a bootstrap class to your html div
Elbert Cortez
@trip16661
Apr 07 2016 04:12
oh y
i think that's because i wanted to make it simple but i guess thing mixed up a bit
Paul Ballardin
@outsmart
Apr 07 2016 04:13
@MMux this is the error that stopped me in my tracks and has made me thow my hands in the air ```XMLHttpRequest cannot load http://api.jquery.com/ajax/test.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. The response had HTTP status code 404.
Mike Moss
@MMux
Apr 07 2016 04:13
@outsmart here's a link to mine if this helps. I think you have to use JSONP json w/ padding; otherwise you won't get a response
http://codepen.io/MMux/pen/qZVyMa
try adding &callback=? to the end of your request
Paul Ballardin
@outsmart
Apr 07 2016 04:13
ok, @MMux let me give that an attempt... thanks!
CamperBot
@camperbot
Apr 07 2016 04:13
outsmart sends brownie points to @mmux :sparkles: :thumbsup: :sparkles:
Elbert Cortez
@trip16661
Apr 07 2016 04:15
@random-x y i think that bug is kind of complicated since now i relise that arrows will only work with the people searched
Michael Karpinski
@karpimpski
Apr 07 2016 04:15
how would I be able to use a database for random quotes and sources? in my random quote generator I made I just had a function to push quotes and sources to arrays.
Paul Ballardin
@outsmart
Apr 07 2016 04:16
@karpimpski did you try use a random quote api first?
Michael Karpinski
@karpimpski
Apr 07 2016 04:17
@outsmart no, I didn't think about APIs until after I finished the project. is there any way to quickly make my own simple API for things like that? I'd like to have custom quotes
random-x
@random-x
Apr 07 2016 04:17
@trip16661 ahh..sorry :( didn't mean to cause more work :( but you can now either simplify it or change the way you implement it maybe. Maybe make a "Random" button and a "More from this Author" button? and program the "More from this Author" to do a new search...? not sure
Elbert Cortez
@trip16661
Apr 07 2016 04:18
the only whay to make it work
is to making them appear only when putting an input
and dissaper if random is clicked
that's the only way i can think of
i just thought of that
random-x
@random-x
Apr 07 2016 04:18
@trip16661 that is a good idea, too!
Elbert Cortez
@trip16661
Apr 07 2016 04:19
i will just try to find how to do that first xD
i thought of it but I don't have the skills :P
random-x
@random-x
Apr 07 2016 04:19
you have the skill.. just not yet the knowledge :P
Elbert Cortez
@trip16661
Apr 07 2016 04:20
nah man it took me 2 days to do it was stuck so many times i really suck at this xDD hope some day i get decent though xDD
random-x
@random-x
Apr 07 2016 04:39
@trip16661 it's a bit of aptitude, a bit of skill, and a lot of persistence. :)
Jeff
@adzam5
Apr 07 2016 04:42
This message was deleted
Eric Murta
@murtinha
Apr 07 2016 04:51

@murtinha
Guys, whats missing here?

function telephoneCheck(str) {
  // Good luck!
  var regExp=/^1?[\s-]?[^\(]?([0-9]{3})[\)$]?[\s\-]?([0-9]{3})[\s-]?([0-9]{4})$/;
  return regExp.test(str);
}



telephoneCheck("(275)76227382");

its challenge Validate US Telephone Numbers

random-x
@random-x
Apr 07 2016 05:14
@murtinha before your first block of 3 digits, you have [^\(]? which means "optionally match anything EXCEPT FOR ("
Eric Murta
@murtinha
Apr 07 2016 05:16
@random-x just changed that, thanks man! But its still not working
CamperBot
@camperbot
Apr 07 2016 05:16
murtinha sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:star: 118 | @random-x | http://www.freecodecamp.com/random-x
random-x
@random-x
Apr 07 2016 05:16
what's the updated regex?
Eric Murta
@murtinha
Apr 07 2016 05:17
@random-x /^1?[\s-]?^[(]?([0-9]{3})[)$]?[\s-]?([0-9]{3})[\s-]?([0-9]{4})$/;
random-x
@random-x
Apr 07 2016 05:20
@murtinha sooo.. there's a few problems here... you didn't actually fix that correctly exactly ;)
Eric Murta
@murtinha
Apr 07 2016 05:22
@random-x I still struggle with regxp
random-x
@random-x
Apr 07 2016 05:23
hmm.. you might want to try a site like http://www.regexr.com/ or http://www.regex101.com/
they will show you what you're matching, dynamically, and tell you what each character means
@murtinha one important thing to note in your testing: your test (telephoneCheck("(275)76227382");) should properly FAIL since it is too long
Eric Murta
@murtinha
Apr 07 2016 05:25
@random-x I did all steps already at regxr
@random-x its failing though
@random-x How can I not permit something like (555 ?
random-x
@random-x
Apr 07 2016 05:30
@murtinha not so easy a Q :) the best way is to do the following:
match (555) OR 555
that way, you won't match (555 or 555)
Eric Murta
@murtinha
Apr 07 2016 05:33
@random-x shiiiit when I fix something, I break other hahahaha omg
random-x
@random-x
Apr 07 2016 05:33
@murtinha ;)
I have to go to bed soon, but paste what you have and I'll give you a last couple hints
Eric Murta
@murtinha
Apr 07 2016 05:34
@random-x thanks man!!! just did it know!
CamperBot
@camperbot
Apr 07 2016 05:34
murtinha sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:warning: murtinha already gave random-x points
random-x
@random-x
Apr 07 2016 05:34
oh, gj :)
Eric Murta
@murtinha
Apr 07 2016 05:34
@random-x figure it out hahaha
Leah H
@leah-h
Apr 07 2016 05:39
This message was deleted
CamperBot
@camperbot
Apr 07 2016 05:39
no wiki entry for: please with the buttonclick to tweet the quote and not linkpre-defined text
Zoher Ali
@Zoher-ali
Apr 07 2016 05:42
how to add twitter icon through font awesome?
Leah H
@leah-h
Apr 07 2016 05:45
This message was deleted
CamperBot
@camperbot
Apr 07 2016 05:45
no wiki entry for: please with the buttonclick to tweet the quote and not linkpre-defined text p data-height268 data-theme-id0 data-slug-hashmyenmj data-default-tabresult data-userleah-h data-previewtrue classcodepensee the pen a hrefhttpcodepenioleah-hpenmyenmjrand quote gen v2a by leah h a hrefhttpcodepenioleah-h@leah-ha on a hrefhttpcodepeniocodepenapscript async srcassetscodepenioassetsembedeijsscript
Zoher Ali
@Zoher-ali
Apr 07 2016 05:47
plz sm1 help
Leah H
@leah-h
Apr 07 2016 05:48
a little help with the twitter button to tweet the quote generatedhere's my link: http://codepen.io/leah-h/pen/MyENmj
Zoher Ali
@Zoher-ali
Apr 07 2016 05:53
I have included fa fa-twitter class and also included font awesome library but its not working why?
Leah H
@leah-h
Apr 07 2016 05:55
@Zoher-ali it would help if you can show us your code
kirbyedy
@kirbyedy
Apr 07 2016 05:55
@leah-h you should target your tweet button with "on click" and then get the text from your quote
you might also open a new window if you want
Leah H
@leah-h
Apr 07 2016 05:58
@kirbyedy that's my problem. JS is throwing me for a loop.
kirbyedy
@kirbyedy
Apr 07 2016 05:59
@leah-h well I opened the console of your pen, and there are couple of errors
$("#yourtweetbutton").on("click", function() {
    window.open("http://twitter.com/home/?status=" + $("#yourquote").text();
  });
this is how your tweet should look like... its an example
The-Seth
@The-Seth
Apr 07 2016 06:02
Hi guys. I just finished until before the random quote generator project. I am going to start on it, so I wanted to ask if anybody has come across a good article/resource/tutorial to use APIs?
Leah H
@leah-h
Apr 07 2016 06:02
@kirbyedy thanks! i'll go ahead and try to make it work...errors?
The-Seth
@The-Seth
Apr 07 2016 06:02
and also a good API for random quotes
CamperBot
@camperbot
Apr 07 2016 06:02
leah-h sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 807 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Apr 07 2016 06:03
@The-Seth there are plenty of them, you can choose whichever you want
@leah-h the first I see is getting $ undefined, which tells me jquery is not embedded, but I checked it, and its there
what you can do, is to put it as first end then, the others... like bootstrap and so on
@leah-h also your background image does not load, I guess this google link is not public for everyone
The-Seth
@The-Seth
Apr 07 2016 06:08
thanks @kirbyedy. any help on how to use them?
CamperBot
@camperbot
Apr 07 2016 06:08
the-seth sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 808 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Apr 07 2016 06:10
@The-Seth on all those sites there is a documentation, and an example, so read through, and if you get stuck ask a question here
someone will help
JScapin
@JScapin
Apr 07 2016 06:13
hi everybody, which images stocker do you use in codepen ?
kirbyedy
@kirbyedy
Apr 07 2016 06:14
can you explain please, I dont understand
JScapin
@JScapin
Apr 07 2016 06:16
I use zup-image, i already try google drive but even if i change settings of rights to put it public it doesn't work. @kirbyedy i mean website to stock picture and photos for our <img/> and background-image...
sorry for my bad english
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:16
Help with this code, the loop worked through the query, however non of the if statement worked. How can I make the if statements work
$(document).ready(function(){




var users =  ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff","ESL_SC2"];
  for (var i=0; i<users.length; i++) {

$.getJSON("https://api.twitch.tv/kraken/streams/"+users[i]+"?callback=?", function(data) {


 /*$("#results").empty();*/
if (data.stream !== "null") {
$("#results").append("<img src="+data.stream.channel.profile_banner>+"</img>");


 /*$("#results").animate("#003300");*/
}
if (data.error) {
  $("#results").append("<p>account closed <br>"+users[i]+"</p>");
}
if (data.stream === "null") {
   $("#results").append("<p>offline <br>"+data.channel.display_name+"</p>"); 
}

console.log(data);


  document.getElementById("test").innerHTML = data.stream.channel.profile_banner;

});
  }
CamperBot
@camperbot
Apr 07 2016 06:16
no wiki entry for: with this code the loop worked through the query however non of the if statement worked how can i make the if statements workdocumentreadyfunctionvar users freecodecamp storbeck terakilobyte habathcxrobotcalebthomasballingernoobs2ninjasbeohoffesl_sc2 for var i0 iuserslength i getjsonhttpsapitwitchtvkrakenstreamsusersicallback functiondata resultsemptyif datastream null resultsappendimg srcdatastreamchannelprofile_bannerimg resultsanimate003300if dataerror resultsappendpaccount closed brusersipif datastream null resultsappendpoffline brdatachanneldisplay_namep consolelogdata documentgetelementbyidtestinnerhtml datastreamchannelprofile_banner
Bruce Young
@mutantspore
Apr 07 2016 06:16
@JScapin
JScapin
@JScapin
Apr 07 2016 06:17
i search one which can allow me to have folders
Bruce Young
@mutantspore
Apr 07 2016 06:17
@Itsdenty try removing the quotes around null
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:17
Thanks @mutantspore let me try that out
CamperBot
@camperbot
Apr 07 2016 06:17
itsdenty sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1366 | @mutantspore | http://www.freecodecamp.com/mutantspore
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:20
Removing the quote didn't solve the problem
The-Seth
@The-Seth
Apr 07 2016 06:20
what happens when I just use $.someFunction() , instead of $(someElement).someFunction() ?
Bruce Young
@mutantspore
Apr 07 2016 06:21
@Itsdenty show me the pen?
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:22
Bruce Young
@mutantspore
Apr 07 2016 06:22
@Itsdenty it is null not “null” but the other thing is that the for loop wil race through and not deal with the asychronous nature of the api calls. .forEach is a better way to do it.
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:25
Not sure of the for each syntax, have a vague knowledge about it, may be I should go n read about it. Hope the for each method would be called b4 the Api query?
Bruce Young
@mutantspore
Apr 07 2016 06:25
i’m looking at it. seems to be som eerror in console too
Zoher Ali
@Zoher-ali
Apr 07 2016 06:26
How to get quote text to twitter text box in random qoute machine?
Robert Uivarosi
@URobert
Apr 07 2016 06:28
@Zoher-ali read this: http://denvycom.com/blog/twitter-button-with-dynamic-custom-data-text-message/ It helped me with the matter
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 06:28
The errors were due to the document method I called for the banner picture the method tried to get the banner for all the looped query however only the streaming user would return a banner others gave error @mutantspore
@Itsdenty yes you’ll need to do anothher api call to get the details of the offline users
using https://api.twitch.tv/kraken/channels/
Zoher Ali
@Zoher-ali
Apr 07 2016 06:48
@URobert how to paste quote in twitter text area ... i m not getting there
Robert Uivarosi
@URobert
Apr 07 2016 06:49
@Zoher-ali for how long have you been trying ?
Ivan
@elementWebDev
Apr 07 2016 06:49
http://codepen.io/fu11st4ck/full/YqEeXM/ can I get brownie points for this? lol
Zoher Ali
@Zoher-ali
Apr 07 2016 06:49
half an hour :worried:
 document.getElementById("twitter_link").setAttribute("data-text",q);
i have done this
Robert Uivarosi
@URobert
Apr 07 2016 06:50
@Zoher-ali heh , keep trying :) If nothing else works, here is the way I did it... but you should not look at the code IMO until you've been trying to solve it on your own for at least a few hours/days ;P http://codepen.io/URobert/pen/WQgqve
gtg
Ivan
@elementWebDev
Apr 07 2016 06:54
gn all
Bruce Young
@mutantspore
Apr 07 2016 06:55
@Itsdenty ok there is the basic bit working .. there were syntax errors in the image tag. you’ll need to do the second api call to get the offline users info.
http://codepen.io/MutantSpore/pen/ZWvQvW?editors=1010
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:02
Thanks @mutantspore you have been most helpful
CamperBot
@camperbot
Apr 07 2016 07:02
itsdenty sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: itsdenty already gave mutantspore points
JScapin
@JScapin
Apr 07 2016 07:04
TWICH-TV challenge : should we have to know channels name or is there a request to have a random chanel name
kirbyedy
@kirbyedy
Apr 07 2016 07:06
I think there are channels which you should include in the project description
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:08
@JScapin check ur instructions the channel names are there
The user arrays
Also the freecodecamp sample app could offer additional user names as it has more users than the instructions user array
JScapin
@JScapin
Apr 07 2016 07:14
@Itsdenty "check ur instructions the channel names are there" sorry i didn't understand that sentence
Bruce Young
@mutantspore
Apr 07 2016 07:15
@JScapin if you read the project instructions carefully you wil see a list of usernames, in several places
Bruce Young
@mutantspore
Apr 07 2016 07:16
@JScapin and also #7 for those who no longer have accounts
JScapin
@JScapin
Apr 07 2016 07:17
thanks @Itsdenty @mutantspore i m going to do that
CamperBot
@camperbot
Apr 07 2016 07:17
jscapin sends brownie points to @itsdenty and @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1367 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 281 | @itsdenty | http://www.freecodecamp.com/itsdenty
Bruce Young
@mutantspore
Apr 07 2016 07:18
@JScapin and to make sure you have someone who will be online 24/7 you can try “monstercat”
JScapin
@JScapin
Apr 07 2016 07:18
this array of active usernames has got a name ?
Bruce Young
@mutantspore
Apr 07 2016 07:19
@JScapin this is my list. It has more than required so I didn’t miss a case.
  var twitchUsers = [
    "freecodecamp",
    "storbeck",
    "terakilobyte",
    "habathcx",
    "RobotCaleb",
    "comster404",
    "brunofin",
    "thomasballinger",
    "noobs2ninjas",
    "beohoff",
    "medrybw",
    "fixt",
    "monstercat",
    "aces_tv",
    "youredm",
    "karachencev",
    "behkuhtv"
  ];
@JScapin well they are not all active or online.. that’s part of the challenge
JScapin
@JScapin
Apr 07 2016 07:25
i wonder one question, a noob question, where do you see the console.log(data) of mycodepen ? in my browser console? if nothing appears, something is wrong in my getJSON request ?
Bruce Young
@mutantspore
Apr 07 2016 07:27
the actual browser console.
well are there errors in the browser console?
JScapin
@JScapin
Apr 07 2016 07:29
finally not : i can see the object of freecodecamp channel
The-Seth
@The-Seth
Apr 07 2016 07:30
Hi! :) I am trying to test the api for my random generator project . It doesn't seem to work correctly. Can anyone tell me if I did everything correctly at my end?
Bruce Young
@mutantspore
Apr 07 2016 07:30
yes, it’s actually streaming now … add in monstercat and it should show also
JScapin
@JScapin
Apr 07 2016 07:30
i understand that we have to create an array, and push in it several channel by ourself
The-Seth
@The-Seth
Apr 07 2016 07:31
This is the api I am using - http://forismatic.com/en/api/
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:31
Is it possible for a css selector for all img tags to select appended img elements using jquery?
Samuel Cupidon
@Zerazera
Apr 07 2016 07:31
@Itsdenty When in doubt, use a class
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:34
@Zerazera if it won't select appended tags it won't appended class too.
JScapin
@JScapin
Apr 07 2016 07:35
@Itsdenty thanks
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:36
Reason being appended elements only get written to the document after my documents get ready, they are not an original html document elements
I only wish to know if they yet can be styled using css as using the div class element won't resize the appended image. I actually intend to resize all appended images
Ur welcome @JScapin
Samuel Cupidon
@Zerazera
Apr 07 2016 07:40
@Itsdenty After being appended they should be selectable like anything else
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:41
Thanks @Zerazera
CamperBot
@camperbot
Apr 07 2016 07:41
itsdenty sends brownie points to @zerazera :sparkles: :thumbsup: :sparkles:
:star: 309 | @zerazera | http://www.freecodecamp.com/zerazera
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:42
The Seth, when I created my random quote app, I didn't use any api, I created my random quote array myself, n it works fine, except It has limited quotes in its library.
Samuel Cupidon
@Zerazera
Apr 07 2016 07:43
@Itsdenty You should take the opportunity to learn a JSON API. Especially because the weather app will take much more time and be much more frustrating than you think.
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:43
But @The-Seth you dudn
@Zerazera I learned api with the weather app, now on the twitch TV app
N that was why I asked the css selector questions
Samuel Cupidon
@Zerazera
Apr 07 2016 07:45
Sweet
Abd-afeez Abd-hamid Adedamola
@Itsdenty
Apr 07 2016 07:46
Got to resize returned images
They were too big for comfort
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 07:58
Quick question, is there a alternative of using media queries in bootstrap ?
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 08:24
erm... is these the alternative for using media queries with bootstrap ?? http://getbootstrap.com/css/#mixins
kirbyedy
@kirbyedy
Apr 07 2016 08:44
I have really no clue, but what is wrong with the media queries ?
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 08:46
@kirbyedy I am already using boot strap , so I thought there would be a much faster way to do this... I am really enjoying how much time and useless fuss bootstrap saves while designing a web site
kirbyedy
@kirbyedy
Apr 07 2016 08:48
found this one, if you want to play
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 08:49
@kirbyedy thanks a lot ! :smile:
CamperBot
@camperbot
Apr 07 2016 08:49
mr-kumar-abhishek sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 810 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 08:50
@kirbyedy however I should use media queries with it too for devices that don't support javascript or have them disabled
@kirbyedy I will suck it up with media queries... then //
kirbyedy
@kirbyedy
Apr 07 2016 08:53
yea
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 08:59
@kirbyedy I will just push them all in @media (max-width: @screen-xs-max) { ... }
96street
@96street
Apr 07 2016 09:07
<div class="prices">
<ul>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>

    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
    <li>c</li>
</ul>
</div>
.prices li:first-child {
    border-radius: 10px 10px 0 0;
}
how does this work if <li> doesn't have a first-child?
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 09:16

@96street shouldn't that be ..

.prices ul li:first-child {
  border-radius: 10px 10px 0 0;
}

or ..

.prices ul li:first-child {
 border-radius: 10px 10px 0px 0px
}

??

:confused:
96street
@96street
Apr 07 2016 09:34
isn't that the same thing? @Mr-Kumar-Abhishek
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 07 2016 09:36
@96street as far as i know you have to follow the order if li is in ul you have to write them ul before li. and .. using px for pixels makes sense there is percentage values too , also not using ; on last property of css class was the syntax I was taught but use them it doesn't makes a difference.
@96street oh yes and there is em values too.. for webkit ..
Islam Ibakaev
@dagman
Apr 07 2016 10:02
is it me or people build js calculator not correctly?
Chad Kreutzer
@ChadKreutzer
Apr 07 2016 11:27
didn't we already go over this?
kirbyedy
@kirbyedy
Apr 07 2016 11:31
thats his style, spamming every channel with the same question :D
Chad Kreutzer
@ChadKreutzer
Apr 07 2016 11:34
at least he has style, I guess.
TheLastOneOut
@TheLastOneOut
Apr 07 2016 11:34
Hi all - first time asking for help on here so apologies if I don't follow the etiquette ;) - I've searched online, and played around for (literally) days on the Wikipedia project. I've made good progress, but am stuck on using .append to add HTML elements to my page (I want to show the entries I have gotten from Wikipedia). Would somebody mind taking a look?
Robert Adamyan
@paerallax
Apr 07 2016 12:10
Hi everyone. Anybody doing the jQuery course? I'm stuck with a problem, I know the solution must be very simple, yet I can't find it. Care to help?
Samuel Cupidon
@Zerazera
Apr 07 2016 12:12
@robertadamian What's the question
Robert Adamyan
@paerallax
Apr 07 2016 12:13
Make the second child in each of your well elements bounce. You must target the children of element with the target class.
$(".well:nth-child(2)").addClass("animated bounce");
TheLastOneOut
@TheLastOneOut
Apr 07 2016 12:13
;'(
Robert Adamyan
@paerallax
Apr 07 2016 12:13
what am I doing wrong?
Samuel Cupidon
@Zerazera
Apr 07 2016 12:14
@robertadamian Javascript is a zero-indexed language
1=0, 2=1, 3=2 and so on
Robert Adamyan
@paerallax
Apr 07 2016 12:16

I know, then why does it say in the instructions --
Here's how you would give the third element in each well the bounce class:

$(".target:nth-child(3)").addClass("animated bounce");

Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:17
Because it's CSS and css goes 1 = 1, 2 = 2, 3 = 3.
Also, it looks like it should work from your example...
Let me take a peek.
Zoher Ali
@Zoher-ali
Apr 07 2016 12:18
Hello can some1 help me with random quote machine
I m not getting how to paste quote to twitter text area???
Robert Adamyan
@paerallax
Apr 07 2016 12:20
It bounces the entire div, not just the 2nd element
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:20
OH
@robertadamian That's because it bounces every well
@robertadamian It will bounce the class that the pseudo-selector is attached to.
Robert Adamyan
@paerallax
Apr 07 2016 12:24
wasn't target:nth-child() supposed to prevent that?
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:28
@robertadamian I don't think so. The nth-child selects the specific element within it's parent and no others. But in this case you'll want to select the button element in the well, not just the well itself.
Zoher Ali
@Zoher-ali
Apr 07 2016 12:30
hey plz some1 help :worried:
Robert Adamyan
@paerallax
Apr 07 2016 12:31
@Gregory-Buhler ah okay, that makes sence. Thank you.
CamperBot
@camperbot
Apr 07 2016 12:31
robertadamian sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
:star: 303 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
Robert Adamyan
@paerallax
Apr 07 2016 12:32
*sense
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:33
@Zoher-ali Just a sec
Zoher Ali
@Zoher-ali
Apr 07 2016 12:33
@Gregory-Buhler ok
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:38
take a look at how they craft their tweet.
Zoher Ali
@Zoher-ali
Apr 07 2016 12:55
@Gregory-Buhler its good with hello world example but not working for quote since its unknown at the time of page load
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:56
The button shouldn't be a link itself, but it should be able to call a javascript function that fires the link.
kirbyedy
@kirbyedy
Apr 07 2016 12:56
pull it on click
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 12:56
What kirby said ^_^
Zoher Ali
@Zoher-ali
Apr 07 2016 12:58
how can i supply link to html attribute in javascript?
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 13:00
As in convert it so that it works with html? Like %20 = [space] ?
kirbyedy
@kirbyedy
Apr 07 2016 13:01
@Zoher-ali how do you write the quote in html ?
Zoher Ali
@Zoher-ali
Apr 07 2016 13:24
@Gregory-Buhler @kirbyedy for sending quote one time is ok. but when i change quote with new quote button the value in of text in href attribute doesn't change why?
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 13:25
Do you update the text var in your function each time you click the tweet button?
kirbyedy
@kirbyedy
Apr 07 2016 13:25
with the tweet button target the div which has your quote text
Zoher Ali
@Zoher-ali
Apr 07 2016 13:27
@kirbyedy @Gregory-Buhler :smile: ok its done actually i have declared quote variable as a local variable ... Thats y it was not changing for all functions...
thank for suggestions @kirbyedy @Gregory-Buhler
CamperBot
@camperbot
Apr 07 2016 13:27
zoher-ali sends brownie points to @kirbyedy and @gregory-buhler :sparkles: :thumbsup: :sparkles:
:star: 812 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
:star: 304 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
kirbyedy
@kirbyedy
Apr 07 2016 13:28
$("#button").on("click", function() {
    window.open("http://twitter.com/home/?status=" + $("#yourquote").text()
Zoher Ali
@Zoher-ali
Apr 07 2016 13:29
@kirbyedy i have not used jquery at ol
kirbyedy
@kirbyedy
Apr 07 2016 13:30
maybe next time :)
Samuel Cupidon
@Zerazera
Apr 07 2016 13:53
Hi, I'm looking for feedback on my Wikipedia viewer. http://codepen.io/Zeratul/full/YqEdaj/
Marc
@wumpafruits
Apr 07 2016 13:55

<html>
<head>
    <title>Star Wars Spoilers</title>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
    <img src="img/deathstar.png" />
    <p class="spoiler">
        <!--Spoiler:-->
        <span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span>
    </p>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/app.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
$(".spoiler span").hide();
$(".spoiler").append("<button>Reveal Spoiler!</button>");
anyone see the problem here. button shows in codepen but not in browser
Himanshu Pandey
@Adonis2115
Apr 07 2016 13:56
i complted part of of thisbootcamp course now stuck at 'Build a Personal Portfolio Webpage'
dont know where to start
can anyone guide me where what should i do
Marc
@wumpafruits
Apr 07 2016 13:59
@Adonis2115 look at examples and see waht you like
then try implementing those things through research on stackoverflow/google
or pick one part to focus on like html only
then go to css
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:02
@wumpafruits Which browser? How's it being called?
random-x
@random-x
Apr 07 2016 14:19
@wumpafruits are you including jquery?
Zerka1982
@Zerka1982
Apr 07 2016 14:21
Hi guys
I need your help please
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:22
@Zerka1982 Wazzap?
Zerka1982
@Zerka1982
Apr 07 2016 14:22
I would like to be able to click on either buttons
Feedback and Sreach
here is my code please guide me
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:25
They're both clickable, what exactly are you looking for with them?
Zerka1982
@Zerka1982
Apr 07 2016 14:25
Only feedback is clickable :(
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:26
And search needs to be a button?
Zerka1982
@Zerka1982
Apr 07 2016 14:26
yes
it could be a link as well
but the problem I can't click on it
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:27
So are you looking for the pointer to change when you hover over it? Or are you trying to get get it to do something? In it's current state it is clickable, it just has no actions associated with it.
Zerka1982
@Zerka1982
Apr 07 2016 14:29
is Search button clickable ????
Alexandre
@alexandre-mouton-brady
Apr 07 2016 14:29
Hello there, I was wondering if someone could tell me why my link isn't showing up ? I did a lot of research and I know it comes from the href, but I can't figure out a fix :
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:31
@Zerka1982 Your feedback div has a width that covers your button when the height of the browser window is too smal.
Zerka1982
@Zerka1982
Apr 07 2016 14:31
Could you please change the code and send it back please
Dimitris Ioannou
@dioannou30
Apr 07 2016 14:31
can some1 help me the JSON thingy ? http://codepen.io/dioannou/pen/repMOO?editors=1011 what am i doing wrong ? i dont get a back data ?
Coira Ellison
@Coira
Apr 07 2016 14:32
@Dextr36 your link shows up for me. it says Twitter, and when i click on it it opens a twitter page with "Hello"
Alexandre
@alexandre-mouton-brady
Apr 07 2016 14:32
Oh wow, is it only me then ? I'm freaking out since an hour.. Maybe it's just firefox oO
Coira Ellison
@Coira
Apr 07 2016 14:33
@Dextr36 hm, it works ok for me in chrome and firefox
Alexandre
@alexandre-mouton-brady
Apr 07 2016 14:34
@Coira I really am stupid and should've checked out in another browser T-T. It doesn't work in my firefox but does in Edge... Thank you <3
CamperBot
@camperbot
Apr 07 2016 14:34
dextr36 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 542 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Apr 07 2016 14:34
@dioannou30 check your console (the one you get when you press f12, not the codepen one). you get the error VM1864 pen.js:14 Uncaught ReferenceError: lat is not defined
@Dextr36 huh, that's weird. oh well at least it's working :p
@dioannou30 also, you need to put either // or http:// in front of api.openweathermap.org/blah
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:37
#feedback {
    height: 104px;
    width: 100px;
    pointer-events:none;
    position: fixed;
    top: 30%;
    z-index: 999;
    transform: rotate(-90deg);
    -webkit-transform: rotate(-90deg);
}
Dimitris Ioannou
@dioannou30
Apr 07 2016 14:37
@Coira WOW thanks a LOOOOOOOOOOOOT
CamperBot
@camperbot
Apr 07 2016 14:37
dioannou30 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:37
@Zerka1982 That should help
CamperBot
@camperbot
Apr 07 2016 14:37
:star: 543 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Apr 07 2016 14:37
np :)
Matthew Boland
@mattboland
Apr 07 2016 14:39
can someone help me understand why i cannot get anything to append to my calculator screen? http://codepen.io/MattBoland/pen/KzqdOW?editors=1010
Zerka1982
@Zerka1982
Apr 07 2016 14:40
@Gregory-Buhler Thanks a lot !
CamperBot
@camperbot
Apr 07 2016 14:40
zerka1982 sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
:star: 305 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
prashant
@findname
Apr 07 2016 14:44
any one why buttons are not inlining https://codepen.io/findname/pen/qZPwWX?editors=1100
Reggie Washington
@Rwash26
Apr 07 2016 14:49
I can't get the carousel to move or the Prev and Next buttons to work. Anyone know what I screwed up on? Thanks https://codepen.io/rwashington21/full/jqagwN/
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:50
@findname Your nav is set up a bit off, you declared your nav as navtabs, you'll want to change that to a navbar. THen your ul class should be a "nav navbar-nav pull-right" after that remove the pull-right from the li's
  <nav class="navbar navbar-inverse navbar-fixed-top transparent">
    <div class="container-fluid"> 
      <ul class="nav navbar-nav pull-right">
        <li><a href="" class="btn btn-lg btn-primary padding-top">Aboutme</a></li>
        <li><a href="" class=" btn btn-lg btn-primary">Portfolio</a></li> <li><a href="" class="btn btn-lg btn-primary">Contact</a></li></ul> <!-- <a><h1>My Portfolio <h1> --> <a><span class="glyphicon glyphicon-search btn btn-lg"> </span></a> 
    </div>
  </nav>
ehekatlOf
@ehekatlOf
Apr 07 2016 14:51
hey guys
can someone explain how this jquery selector is working?
here's the block for smooth scrolling animation
$('a').click(function() {
    $('html, body').animate({
        scrollTop: $($.attr(this, 'href')).offset().top
    }, 500);
    return false;
});
the selector I'm scratching my head on is $($.attr(this, 'href'))
David Weedmark
@DavidWeedmark
Apr 07 2016 14:52
@findname it's the <li> tags in your HTML.
random-x
@random-x
Apr 07 2016 14:54
@mattboland there's quite a few reasons, but start with this:
  • window is a reserved keyword for the browser window, so trying to overwrite that = not gonna have a good time.
Lanitta
@DivaWeb
Apr 07 2016 14:54
hello campers!!!!
ehekatlOf
@ehekatlOf
Apr 07 2016 14:54
hi there
random-x
@random-x
Apr 07 2016 14:54
hey @DivaWeb
Lanitta
@DivaWeb
Apr 07 2016 14:54
who here as completed the ceasar cipher challenge?
ehekatlOf
@ehekatlOf
Apr 07 2016 14:54
post away
someone will be likely to help
that one was pretty easy IIRC
Lanitta
@DivaWeb
Apr 07 2016 14:55
well I have been trying to get help for days now lol
ehekatlOf
@ehekatlOf
Apr 07 2016 14:55
yeah go for it :p
random-x
@random-x
Apr 07 2016 14:55
@DivaWeb well hey... today may be your lucky day :)
Lanitta
@DivaWeb
Apr 07 2016 14:56

function rot13(str) { // LBH QVQ VG!
var newString ="";
var newCode;
for(i = 0; i < str.length; i++){

newString += str.charCodeAt(i);

}

return newString.split();

}

I have rewritten and researched so many times.
ehekatlOf
@ehekatlOf
Apr 07 2016 14:57
remember to sandwich your code in ```
the markdown makes it much easier to read
Lanitta
@DivaWeb
Apr 07 2016 14:57
I realize that I could just create an index and be done , but from what I understand you need to use the functions they provide to complete it
Samuel Cupidon
@Zerazera
Apr 07 2016 14:57
@DivaWeb No you don't
Get it done the best way you know how
prashant
@findname
Apr 07 2016 14:58
@Gregory-Buhler thanks but why is pull-right not working inside <li>
CamperBot
@camperbot
Apr 07 2016 14:58
findname sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
ehekatlOf
@ehekatlOf
Apr 07 2016 14:58
remember the alphabet can be bisected from the middle
and you can count both ways starting from that letter
CamperBot
@camperbot
Apr 07 2016 14:58
:star: 306 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
Lanitta
@DivaWeb
Apr 07 2016 14:59
so you saying that there is no cryptic way of looping through the two functions that they provide for you research instead of using an index?
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 14:59
@findname It's not that it wasn't working inside of li, it was just a lot more extra code that was uneeded as they were all held within the ul function it was easier to move the block right than each individual piece. The main issue that caused them to shift down was the navtab bootstrap you were using.
@DivaWeb, that's the one where you have to shift the character 13 places right?
ehekatlOf
@ehekatlOf
Apr 07 2016 15:00
you can loop through 2 functions
Lanitta
@DivaWeb
Apr 07 2016 15:00
@Gregory-Buhler yes
@ehekatlOf ok so that is what I have been trying to do but I keep getting told that String.fromCharCode() is not a function
Samuel Cupidon
@Zerazera
Apr 07 2016 15:02
@DivaWeb You have to use fromCharCode as a function of the String object, rather than as a string function
Reggie Washington
@Rwash26
Apr 07 2016 15:02
Can anyone tell me why my Carousel isn't moving? https://codepen.io/rwashington21/full/jqagwN/
Samuel Cupidon
@Zerazera
Apr 07 2016 15:02
So String.fromCharCode(97)
Rather than 'Hi'.fromCharCode(97)
The second one would give you an error
prashant
@findname
Apr 07 2016 15:03
@Gregory-Buhler pull-right inside <li> aren't bringing them right uless i add pull-right to ul
Lanitta
@DivaWeb
Apr 07 2016 15:03
@Zerazera I understand how it is suppose to work but I am not hard coding what the number is
Samuel Cupidon
@Zerazera
Apr 07 2016 15:04
Right. You can get the number by doing something like String.fromCharCode('A'.CharCodeAt())
Lanitta
@DivaWeb
Apr 07 2016 15:04
@Zerazera and that is when I get told that it is not a function
Samuel Cupidon
@Zerazera
Apr 07 2016 15:05
Actually String.fromCharCode('A'.charCodeAt())
If you're getting the "not a function" error it's because you're not calling the prototype method
Javascript knows fromCharCode as a prototype method to the String class
So you have to call it String.fromCharCode()
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 15:06
@findname Because each li has a height (as it is it's own block), and the pull-right is not resizing the block or making it an inline-block, it is simply floating it right, so you have that initial height of the li for each of them.
Samuel Cupidon
@Zerazera
Apr 07 2016 15:07
Otherwise it's gibberish
ehekatlOf
@ehekatlOf
Apr 07 2016 15:07
oh yeah forgot to say, I had to containerize my string for charCodeAt() to work
so something like var test = 's' test.charCodeAt() works
Gregory Buhler
@Gregory-Buhler
Apr 07 2016 15:08
@findname And if two li's are not inline blocks, they will always show below one another. Which is what you have happening right now.
Be back in a few ^_^
ehekatlOf
@ehekatlOf
Apr 07 2016 15:09
not sure if I should post my answer
random-x
@random-x
Apr 07 2016 15:09
@ehekatlOf that's actually not necessary.. though it's a decent idea anyway. 's'.charCodeAt() should work
ehekatlOf
@ehekatlOf
Apr 07 2016 15:09
oh does it?
hm
oh it does
random-x
@random-x
Apr 07 2016 15:09
yep.. it's just a bit sloppy, potentially
Lanitta
@DivaWeb
Apr 07 2016 15:11
@Zerazera @ehekatlOf so I have used var word = string.charCode(string.charCodeAt() ) I have also used return string.charCode(string.charCodeAt() ) I have also even tried a loop lol
Samuel Cupidon
@Zerazera
Apr 07 2016 15:12
@DivaWeb Details are important. String with capital S for fromCharCode method.
String.fromCharCode('a'.charCodeAt()) should run with no errors
Lanitta
@DivaWeb
Apr 07 2016 15:13
@Zerazera so what it 'a' for?
Samuel Cupidon
@Zerazera
Apr 07 2016 15:13
'a' is just a string. That you can replace with a string literal or a string variable
random-x
@random-x
Apr 07 2016 15:14
it is a string.. not to be confused with the String :P
ehekatlOf
@ehekatlOf
Apr 07 2016 15:14
yeah
that's what I was talking about with random-x
haha
Stephen James
@sjames1958gm
Apr 07 2016 15:15
'a'.charCodeAt() - with no parameters it assumes index 0
prashant
@findname
Apr 07 2016 15:15
@Gregory-Buhler removing <li> is also working as pointed by @DavidWeedmark but again pull-right is not working even removing <li> i guess it <ul> that may be creating inline blocks
Lanitta
@DivaWeb
Apr 07 2016 15:16
so what step am I not seeing?
ehekatlOf
@ehekatlOf
Apr 07 2016 15:16
anyways
here's something to get you off the ground
function rot13(encodedStr) {
  var codeArr = encodedStr.split("");  // String to Array
  var decodedArr = [];
first I took the parameter and split into an array
then created an empty array
  for(var i in codeArr) {
      decodedArr.push(codeArr[i].charCodeAt() );
  }
Lanitta
@DivaWeb
Apr 07 2016 15:17
@ehekatlOf I started out putting it into an array as well origianlly
Samuel Cupidon
@Zerazera
Apr 07 2016 15:17
Right. If you wanted to loop through and get the char codes you could do something like
var s='Hello world';
for (var i = 0; i < s.length;  i++) {
   console.log(s.charCodeAt(i));
}
That would print each letter of s to the console
ehekatlOf
@ehekatlOf
Apr 07 2016 15:17
then ran a loop to convert and push the char code into the new array
you should now have an array full of converted char code
should be easy from there
Lanitta
@DivaWeb
Apr 07 2016 15:18
ok so I wasn't making an empty array var I did do the for loop
ehekatlOf
@ehekatlOf
Apr 07 2016 15:19
you don't have to recontainerize it
it's just how I did it
random-x
@random-x
Apr 07 2016 15:19
@ehekatlOf haha.. I like that word ;)
ehekatlOf
@ehekatlOf
Apr 07 2016 15:19
thanks @random-x
CamperBot
@camperbot
Apr 07 2016 15:19
ehekatlof sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:star: 124 | @random-x | http://www.freecodecamp.com/random-x
random-x
@random-x
Apr 07 2016 15:20
@DivaWeb do you know how to log to console and view those logs?
Lanitta
@DivaWeb
Apr 07 2016 15:20
@ehekatlOf @random-x @Zerazera @sjames1958gm thanks all for the help
CamperBot
@camperbot
Apr 07 2016 15:20
divaweb sends brownie points to @ehekatlof and @random-x and @zerazera and @sjames1958gm :sparkles: :thumbsup: :sparkles:
ehekatlOf
@ehekatlOf
Apr 07 2016 15:20
no problem @DivaWeb
keep trying, don't give up
CamperBot
@camperbot
Apr 07 2016 15:21
:star: 244 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
:star: 125 | @random-x | http://www.freecodecamp.com/random-x
:star: 481 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
:star: 318 | @zerazera | http://www.freecodecamp.com/zerazera
Lanitta
@DivaWeb
Apr 07 2016 15:21
@random-x yeah I just feel like I am not seeing something, obviously lol that is why I keep getting that it is not a function
random-x
@random-x
Apr 07 2016 15:22
@DivaWeb ok, well feel free to post again or send me a message once you try out what we spoke about if you're still having issues.
Igor Amelichev
@igoramelichev
Apr 07 2016 15:29
Hey guys, I'm stuck with navigation on my portfolio web page challenge. Can anyone point me to the right direction?
Stephen James
@sjames1958gm
Apr 07 2016 15:35
@igoramelichev post a link or a question -
prashant
@findname
Apr 07 2016 15:38
anyone why is there ehite space in about green and other color and how can it be fixedhttps://codepen.io/findname/pen/qZPwWX?editors=1100
Jeff
@adzam5
Apr 07 2016 15:39
@findname Add
body {
    background-color: #93B874;
}
prashant
@findname
Apr 07 2016 15:47
@adzam5 white space in between (it will work here but again when i will create another div of different color that would show green color betweenthem )
random-x
@random-x
Apr 07 2016 15:51
@findname if you're using Bootcamp already, I would suggest you create the page using bootcamp classes rather than just un-classed divs and such... that will get rid of things like that for you automatically
Ahzux
@AhzuxRamsey
Apr 07 2016 15:52
function lookUpProfile(firstName, prop){
  for (var i=0; i < contacts.length; i++){
    if (contacts[i].firstName === firstName)
    {
      if (contacts[i].hasOwnProperty(prop)===true)
          { return contacts[i][prop];} else {return "No such property";}
        }else return "No such contact";
        }       
}
I'm stucking in above trouble,, that when I delete "else return "No such contact";", every thing is fine. But when it's coded like above, It returns "No such contact" though conditions is true. (My English is so bad -_- and I don't know how I can explain this. )
Stephen James
@sjames1958gm
Apr 07 2016 15:54
@AhzuxRamsey "No such contact" - you have to loop through all contacts this fails on the first contact
kirbyedy
@kirbyedy
Apr 07 2016 15:54
@findname put margin:0 on h2
and if you want to push the About text down, use padding
Ahzux
@AhzuxRamsey
Apr 07 2016 15:56
@sjames1958gm oh, I am going to try to fix this, thanks for your help
CamperBot
@camperbot
Apr 07 2016 15:56
ahzuxramsey sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Stephen James
@sjames1958gm
Apr 07 2016 15:56
@AhzuxRamsey :+1:
CamperBot
@camperbot
Apr 07 2016 15:56
:star: 482 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Dimitris Ioannou
@dioannou30
Apr 07 2016 15:58
any1 willing to solve me a CSS thingy i am missing ?
any1 ?
prashant
@findname
Apr 07 2016 16:01
@kirbyedy h2{
margin-top :0px;
} notworking
its 0 by default i guess
kirbyedy
@kirbyedy
Apr 07 2016 16:03
Screen Shot 2016-04-07 at 19.02.55.png
or maybe I did not understood the problem
Ahzux
@AhzuxRamsey
Apr 07 2016 16:04
@sjames1958gm Can you fix it for me, please. I don't quite understand this :(
function lookUpProfile(firstName, prop){
  for (var i=0; i < contacts.length; i++){
    if (contacts[i].firstName === firstName)
    {
      if (contacts[i].hasOwnProperty(prop)===true)
          { return contacts[i][prop];} else {return "No such property";}
        }
    return "No such contact";
        }       
}
prashant
@findname
Apr 07 2016 16:04
@random-x by bootcamp classes you mean previous freecodecamp tutorial ?
random-x
@random-x
Apr 07 2016 16:05
@findname no, but if you do complete those, you will hopefully understand what I mean :)
Ahzux
@AhzuxRamsey
Apr 07 2016 16:05
@sjames1958gm Oh, I did it, finally I understand what you said :D thanks so much, again
CamperBot
@camperbot
Apr 07 2016 16:05
ahzuxramsey sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: ahzuxramsey already gave sjames1958gm points
kirbyedy
@kirbyedy
Apr 07 2016 16:06
@findname he meant bootstrap classes I think :)
prashant
@findname
Apr 07 2016 16:06
yeah you fixed it green and pink are close in your screen shot but the code i gave is something wrong i did margin-top:0
kirbyedy
@kirbyedy
Apr 07 2016 16:06
also you are missing a jquery in your settings
h2{
  margin-top :0px;
  padding-top:20px; 
}
brb
prashant
@findname
Apr 07 2016 16:08
@random-x what you meant i completed those previous tutorial ?
random-x
@random-x
Apr 07 2016 16:09
@findname alright, do you remember about rows and cols then?
prashant
@findname
Apr 07 2016 16:13
yes grids , so you mean instead of using another div is it better to use rows and cols ?
thanks @kirbyedy that worked but was't it 0 margin by default
CamperBot
@camperbot
Apr 07 2016 16:14
findname sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
random-x
@random-x
Apr 07 2016 16:15
use the grid system... divs with class="row", and inside those nest divs with class="col-lg-6" or whathaveyou
CamperBot
@camperbot
Apr 07 2016 16:15
:star: 813 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Sandra
@SandraFlato
Apr 07 2016 16:21
@yhakong Did you ever resolve your DNA pairing?
ehekatlOf
@ehekatlOf
Apr 07 2016 16:24
going to try again
anybody know how this selector is working?
for this jquery block that does smooth scrolling
$('a').click(function() {
    $('html, body').animate({
        scrollTop: $($.attr(this, 'href')).offset().top
    }, 500);
    return false;
});
Dimitris Ioannou
@dioannou30
Apr 07 2016 16:24
can any1 tell me why the icon doesnt show in this : http://codepen.io/dioannou/pen/repMOO
ehekatlOf
@ehekatlOf
Apr 07 2016 16:24
namely $($.attr(this, 'href'))
Stephen James
@sjames1958gm
Apr 07 2016 16:25
@ehekatlOf Looks like it is using the value of the href as the selector
prashant
@findname
Apr 07 2016 16:25
@random-x done what you said still its same
ehekatlOf
@ehekatlOf
Apr 07 2016 16:26
I think what's tripping me up is the double $
also I didn't know you could select .attr right away
without referencing an element
Stephen James
@sjames1958gm
Apr 07 2016 16:27
I haven't seen that syntax
random-x
@random-x
Apr 07 2016 16:27
@findname hmm.. when I refresh the page, I don't see the div at the bottom having any classes at all?
ehekatlOf
@ehekatlOf
Apr 07 2016 16:27
apparently it works!
totally tripping me up
haha
random-x
@random-x
Apr 07 2016 16:28
@ehekatlOf that is some weird syntax - I prefer $($(this).attr('href'));
ehekatlOf
@ehekatlOf
Apr 07 2016 16:28
yeah
I got it from a thread on stack
never even seen this syntax before
its having class col-lg-6
Clark Arnold
@clarkarnold
Apr 07 2016 16:32
Hey all, i think i got my tic tac toe working for two human players, and tips on getting started with the AI? http://codepen.io/clarkarnold/pen/BKmYeZ?editors=0010
ehekatlOf
@ehekatlOf
Apr 07 2016 16:32
read up on the minimax algorithm
good luck!
Igor Amelichev
@igoramelichev
Apr 07 2016 16:32
@sjames1958gm I'm building a single page portfolio web site in Bootstrap and don't know how to make the nav buttons scroll down the page when I click them.
Clark Arnold
@clarkarnold
Apr 07 2016 16:33
@ehekatlOf I've read a bit about it, seems confusing hah
ehekatlOf
@ehekatlOf
Apr 07 2016 16:33
yeah haha
random-x
@random-x
Apr 07 2016 16:33
@ehekatlOf $ is shorthand for jQuery, so it's actually calling jQuery.attr
ehekatlOf
@ehekatlOf
Apr 07 2016 16:33
oooooh
Clark Arnold
@clarkarnold
Apr 07 2016 16:34
@igoramelichev set the href to the id of the div, for example if your portfolio section is called id="portfolio", set the href="#portfolio"
Stephen James
@sjames1958gm
Apr 07 2016 16:34
@igoramelichev See if this helps http://www.echoecho.com/htmllinks08.htm
random-x
@random-x
Apr 07 2016 16:35
why you'd use that.. I don't know
Stephen James
@sjames1958gm
Apr 07 2016 16:35
@random-x Saves typing - increases obscurity - to prove your chops. No good reason
Zain Ul Haq
@drsherlock
Apr 07 2016 16:35
hi, for some reason i am unable to center the div here, i am trying to use offset but it is not coming exactly in the center, http://codepen.io/drsherlock/pen/yOgvNL
César
@ICesarI
Apr 07 2016 16:35
That sintax reminds me Python.
prashant
@findname
Apr 07 2016 16:35
@random-x did you meant bootstrap or bootcamp that time
random-x
@random-x
Apr 07 2016 16:36
@findname bootstrap
ehekatlOf
@ehekatlOf
Apr 07 2016 16:38
I think I'll get started on C# while the data visualization course is still getting worked on
is something wrong still
random-x
@random-x
Apr 07 2016 16:40
@findname you want to organize your stuff into rows and columns.. a ROW is something that goes across the screen from left to right. a COLUMN goes vertically. if you just want a row without anything else on it, you can make the contents of that row take up all 12 columns. Perhaps something like:
<div class="container-fluid">
   <div class="row">
      <div class="col-lg-12">
          first row, maybe picture?
      </div>
   </div>
   <div class="row">
      <div class="col-lg-12">
          second row, maybe text?
      </div>
   </div>
</div>
prashant
@findname
Apr 07 2016 16:42
my format was <div clss=row>
<nav></nav>
random-x
@random-x
Apr 07 2016 16:42
@findname but then you need to add additional rows for the picture and then for the text at the bottom
prashant
@findname
Apr 07 2016 16:42
<div clss=col>img</div>
random-x
@random-x
Apr 07 2016 16:42
@findname you don't want all of that in just 1 row.
prashant
@findname
Apr 07 2016 16:44
oh, thankyou @random-x
Igor Amelichev
@igoramelichev
Apr 07 2016 16:45
@clarkarnold @sjames1958gm Thank you!
CamperBot
@camperbot
Apr 07 2016 16:45
igoramelichev sends brownie points to @clarkarnold and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 432 | @clarkarnold | http://www.freecodecamp.com/clarkarnold
:star: 485 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
abtak mustapha
@mustapha88
Apr 07 2016 16:46
hello every one and happy coding
can any one help me with random quotes app
prashant
@findname
Apr 07 2016 16:54
@random-x https://codepen.io/findname/pen/qZPwWX?editors=1100 is something wrong still
random-x
@random-x
Apr 07 2016 16:55

@ehekatlOf hmm.. ok, so after analyzing it further, it looks like these are just synonyms:

$(<selector>).<function>(<params>);
$.<function>(<selector>, <params>);

(which sort of makes sense since object oriented programming languages often implicitly pass "this" as the first param to function calls)

@findname try making them col-lg-12 instead of 6. also remove your <center> tags and use bootstrap classes for centering it instead.
willamgriffin
@willamgriffin
Apr 07 2016 17:01
i'm so excited this is finally functioning
the .getjson wouldnt fire while my text field was inside a <form>
while using bootstrap
hahahahahahahah
@findname how id you set a background image in the codepen preview like that?
prashant
@findname
Apr 07 2016 17:05
@willamgriffin div#f{
background-color:#FFEBCD;
}
its not centered also though i used cantered
centered
willamgriffin
@willamgriffin
Apr 07 2016 17:07
oh derpy me i thought it was a codepen thing
gotta do job stuffs now
random-x
@random-x
Apr 07 2016 17:07
@findname check what the bootstrap class is for centering. it's not named centered :)
@findname I am trying to get you to find the answers yourself to learn
prashant
@findname
Apr 07 2016 17:08
copying from stakflow
body class="container">
<div class="col-lg-1 col-offset-6 centered">
<img data-src="holder.js/100x100" alt="" />
</div>
</body>
@willamgriffin good bye
random-x
@random-x
Apr 07 2016 17:09
@findname try copying not from stakflow but from bootstrap's site or freecodecamp :)
prashant
@findname
Apr 07 2016 17:16
@random-x its text-center
random-x
@random-x
Apr 07 2016 17:16
@findname yes! :)
prashant
@findname
Apr 07 2016 17:16
actually centered was i guess to center whole coloum
@random-x but still that color isn't spread all over https://codepen.io/findname/pen/qZPwWX?editors=1100
random-x
@random-x
Apr 07 2016 17:18
@findname in what browser? it is in FF and Chrome? :S
prashant
@findname
Apr 07 2016 17:19
its in codepen
random-x
@random-x
Apr 07 2016 17:19
unless you mean the bottom of the page...??
prashant
@findname
Apr 07 2016 17:21
@random-x what bottom of page? though i am chatting you in ff same browser
random-x
@random-x
Apr 07 2016 17:21
@findname I have no idea what you mean. it shows up properly for me.
prashant
@findname
Apr 07 2016 17:23
you dont see the white space between that pinklike and green background
?
random-x
@random-x
Apr 07 2016 17:24
no
ahh... I see why.
add col-xs-12 to both of those divs
prashant
@findname
Apr 07 2016 17:30
yes thanks @random-x now it worked. what was wrong with lg
CamperBot
@camperbot
Apr 07 2016 17:30
findname sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:star: 126 | @random-x | http://www.freecodecamp.com/random-x
random-x
@random-x
Apr 07 2016 17:34
@findname so bootstrap uses "breakpoints" for different screensizes to determine how to show an image. because your screen is smaller than the "large" (lg) breakpoint, it didn't know how to handle it because we never defined smaller sizes
@findname to see it in action, try this (you can remove it after): assign 2 classes to the divs:
col-xs-12 col-md-8
@findname once you do that to all the divs, try shrinking your browser window to make it less wide
@findname you'll notice at the beginning, there's a gap on the right - 4 columns of whitespace, since we told it to take up 8 columns on a "medium" (md) display. when the browser shrinks to "extra small" (xs) size, it grows to fill up all 12 columns
@findname that is where the name "responsive" web design comes from.. it "responds" to the size of the viewport so it can appear differently on mobile device screens vs. desktop to accommodate the specific needs of each environment
Kama David
@Kama-David25
Apr 07 2016 17:40
Hey guys, i need some help with file read and write in java. anyone familiar with that stuff?
prashant
@findname
Apr 07 2016 17:41
@random-x to the same classes ?
sorry to came col ?
random-x
@random-x
Apr 07 2016 17:41
@findname yep, both classes to the same div. apply it to all of them (you can remove the col-md-8 afterwards.. it's just to demonstrate)
@Kama-David25 I haven't really used Java in a long time :(
Kama David
@Kama-David25
Apr 07 2016 17:43
lol Im just starting and I have a project which I have literally been up all night trying to complete to no avail @random-x
Achilleas Papakonstantinou
@AchiPapakon
Apr 07 2016 17:46
This message was deleted
textArea
    resize:none

Hi, I can't understand why the above lines in Sass don't compile into:

#textArea {
    resize:none
}

http://codepen.io/AchiPapakon/pen/YqYGEL

prashant
@findname
Apr 07 2016 17:52
@random-x i dont see gaphttps://codepen.io/findname/pen/qZPwWX?editors=1000 i think i need to make each of div responsive as they are separate and i have only imageresponsive
random-x
@random-x
Apr 07 2016 17:52
@AchiPapakon doesn't Sass use CSS syntax, it just also accepts nested CSS and variables...?
@findname you only made the bottom one md-8.. the others you made md-12. but take a look at the bottom div
prashant
@findname
Apr 07 2016 17:53
@random-x i dont see white spaces
random-x
@random-x
Apr 07 2016 17:53
@findname see how there is a white gap on the right until you shrink your browser window?
Achilleas Papakonstantinou
@AchiPapakon
Apr 07 2016 17:54
@random-x http://sass-lang.com/guide sass doesn't use brackets {}
prashant
@findname
Apr 07 2016 17:55
col-md-8 col-xs-12 should i reverse is cuz this is what i used
random-x
@random-x
Apr 07 2016 17:56
@AchiPapakon ok, but still it seems to use #id for id's
@findname no, it's fine.. just look at only the bottom div.. the one that says "Aout"
@findname do you see a white space on the right?
prashant
@findname
Apr 07 2016 17:56
yes it contain both col-md-8 col-xs-12
Achilleas Papakonstantinou
@AchiPapakon
Apr 07 2016 17:57
@random-x nothing changes with the addition of #
random-x
@random-x
Apr 07 2016 17:57
@findname with your browser window at max size
@AchiPapakon ok. I don't really know about Sass very much, so I will have to defer to others :(
prashant
@findname
Apr 07 2016 17:58
yes my browser is at max size
random-x
@random-x
Apr 07 2016 17:58
@findname how big is your monitor? resolution?
prashant
@findname
Apr 07 2016 17:58
now if i shrink i dont see white spaces
1366*768
random-x
@random-x
Apr 07 2016 18:01
@findname ok, so you don't see any white gap at the bottom right hand corner, below the green background?
@findname even with browser window max sized?
prashant
@findname
Apr 07 2016 18:03
oh its after i have reduced the coding area i am able to see
random-x
@random-x
Apr 07 2016 18:03
@findname :)
@findname now make the window less wide --><--
abtak mustapha
@mustapha88
Apr 07 2016 18:04
any one test my app and give some feedback
random-x
@random-x
Apr 07 2016 18:04
@random-x and watch - the white gap will disappear
prashant
@findname
Apr 07 2016 18:05
yes @random-x
random-x
@random-x
Apr 07 2016 18:06
@findname awesome. ok.. that is because at a MEDIUM size screen, you have the bottom div taking up col-md-8 columns out of 12. for an EXTRASMALL size screen, you have the bottom div taking up col-xs-12 out of 12
@findname that is responsive design. now I leave you to do the rest :P
prashant
@findname
Apr 07 2016 18:07
but i didn't used any responsive class in this div area
random-x
@random-x
Apr 07 2016 18:08
bootstrap is built to be responsive. your outside div is container-fluid which is a responsive bootstrap class
anyway... good luck with the rest of the assignment!! :)
@mustapha88 the tweet button doesn't seem to work correctly :(
abtak mustapha
@mustapha88
Apr 07 2016 18:10
@random-x what's the probleme
prashant
@findname
Apr 07 2016 18:10
no container-fluid is on the different is in different class https://codepen.io/findname/pen/qZPwWX?editors=1000
@random-x
random-x
@random-x
Apr 07 2016 18:10
@findname yes. that's how it works.
prashant
@findname
Apr 07 2016 18:10
soory diiferent div
Achilleas Papakonstantinou
@AchiPapakon
Apr 07 2016 18:10

Solution:

#textArea
    resize: none

I didn't have space between : and none.....

random-x
@random-x
Apr 07 2016 18:10
@mustapha88 try clicking it - it doesn't "pre-populate" my tweet
prashant
@findname
Apr 07 2016 18:12
@random-x its on nav div separate from the outside div you taking
abtak mustapha
@mustapha88
Apr 07 2016 18:12
@random-x you mean it should copy the quote directly
random-x
@random-x
Apr 07 2016 18:12
@mustapha88 I assume that's what you intended, but I could be wrong!
abtak mustapha
@mustapha88
Apr 07 2016 18:13
@random-x it take you to twiter?
random-x
@random-x
Apr 07 2016 18:13
@findname ok. don't worry about it :) row is also responsive, though you should wrap everything in a container-fluid or container, really
@mustapha88 yes, it does do that :) never mind! :)
abtak mustapha
@mustapha88
Apr 07 2016 18:14
@random-x yu have idea what is needing ?
prashant
@findname
Apr 07 2016 18:15
and one more thing @random-x when i shrink the size those buttons home about contact comes outside of nav bar area
isnt responsive design should do something about it
random-x
@random-x
Apr 07 2016 18:19
@findname you might want to read about collapsing navbars in bootstrap.
prashant
@findname
Apr 07 2016 18:21
and also @random-x col-md-8 or col-xs-8 are giving covering area
random-x
@random-x
Apr 07 2016 18:21
@findname don't know what you mean. feel free to remove that and replace with xs-12
prashant
@findname
Apr 07 2016 18:25
@random-x see "this is a lion text " is been covered https://codepen.io/findname/pen/qZPwWX?editors=1000
random-x
@random-x
Apr 07 2016 18:26
@findname I think I've helped all I can really for now... :(
prashant
@findname
Apr 07 2016 18:27
thanks @random-x but did you get the problem?
CamperBot
@camperbot
Apr 07 2016 18:27
findname sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
:warning: findname already gave random-x points
random-x
@random-x
Apr 07 2016 18:29
I don't think so
prashant
@findname
Apr 07 2016 18:30
what ?that "this is a lion" "th" part is not covered ? can it be seen
Ashutosh Parmar Jain
@AshutoshParmar
Apr 07 2016 18:31
@findname -I have done the changes
Is that what you were looking for?
prashant
@findname
Apr 07 2016 18:33
@AshutoshParmar where's the link or screenshot ?
Ashutosh Parmar Jain
@AshutoshParmar
Apr 07 2016 18:35
I thought the hitting th fork button would change the code..
anyway try adding a tag element such as <p>this is the line </p> and give it a style so that the text appear in the center...like <p style="text-align:center">This is the lion</p>
Jeff
@adzam5
Apr 07 2016 18:37
@AshutoshParmar When you hit fork it copies the code to a new pen in your portfolio. To share changes you make to a forked pen you can copy and paste the link
Ashutosh Parmar Jain
@AshutoshParmar
Apr 07 2016 18:38
@adzam5 Thank you to teach me how to Fork:D
CamperBot
@camperbot
Apr 07 2016 18:38
ashutoshparmar sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 397 | @adzam5 | http://www.freecodecamp.com/adzam5
prashant
@findname
Apr 07 2016 18:39
@AshutoshParmar i want to left align that? actual problem is some portion is still being covered i don't know wether that is due the margin of coding area or with the code
Ashutosh Parmar Jain
@AshutoshParmar
Apr 07 2016 18:39
@findname Ok!Let me check
@findname Remove padding property from selector id ="e".
Alex
@Jeckstex
Apr 07 2016 18:44
Hello campers! I am working on the Wikipedia Viewer Project. For those who have already finished this project, could you please tell me how you get the links of the pages that you search? I have already figured out how to find different results for the search with https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&srsearch=mia
Just click on "make request" button and it will show the results for "mia".
Thank you :)
prashant
@findname
Apr 07 2016 18:46
@AshutoshParmar you see the white space have occured ? though i don't understand why but this is now beign displayed but white white space has occured padding was to avoid that
Ashutosh Parmar Jain
@AshutoshParmar
Apr 07 2016 18:49
I dont see white spaces :/
prashant
@findname
Apr 07 2016 18:52
for the code that you gave link ? white space between black nav bar and green background ?
Dustin
@dustininkster
Apr 07 2016 18:53
I'm working on the personal portfolio. I'm stuck on the thumbnail links. Can someone tell me why I can't do this:''' <a href="xyz"><iframe src="xyz" scrolling="no"></iframe></a>'''
CamperBot
@camperbot
Apr 07 2016 18:53
:bulb: to format code use backticks! ``` more info
Dustin
@dustininkster
Apr 07 2016 18:54
<a href="xyz"><iframe src="xyz" scrolling="no"></iframe></a>
Alex
@Jeckstex
Apr 07 2016 19:00
Hello campers! I am working on the Wikipedia Viewer Project. For those who have already finished this project, could you please tell me how you get the links of the pages that you search? I have already figured out how to find different results for the search with https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&srsearch=mia
Just click on "make request" button and it will show the results for "mia".
Thank you :)
prashant
@findname
Apr 07 2016 19:01
@AshutoshParma thanks in your link i still see it but when i edited in my it worked but dont understand how removing padding worked.
CamperBot
@camperbot
Apr 07 2016 19:01
findname sends brownie points to @ashutoshparma :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for ashutoshparma
ehekatlOf
@ehekatlOf
Apr 07 2016 19:15
ok, I still don't think I understand how a nested jquery selector works
like $($(element))
Stephen James
@sjames1958gm
Apr 07 2016 19:18
@ehekatlOf Far as I can tell that does nothing.
ehekatlOf
@ehekatlOf
Apr 07 2016 19:18
hm
Stephen James
@sjames1958gm
Apr 07 2016 19:19
@ehekatlOf I tried $($("body")) $($($("body"))) and they seem to return the same as $("body")
ehekatlOf
@ehekatlOf
Apr 07 2016 19:20
thanks @tommygebru I'm actually reading through that
CamperBot
@camperbot
Apr 07 2016 19:20
ehekatlof sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 692 | @tommygebru | http://www.freecodecamp.com/tommygebru
abtak mustapha
@mustapha88
Apr 07 2016 19:20
some one to help
how to pre populate quotes en twiteer
ehekatlOf
@ehekatlOf
Apr 07 2016 19:21
@sjames1958gm it's mainly about that thing I was asking about earlier
scrollTop: $($.attr(this, 'href')).offset().top }, 500)
I've tried everything I can to un-nest it
so the thing is I actually have no idea what it's doing nested
link to pen
Jeff
@adzam5
Apr 07 2016 19:26
@mustapha88 http://twitter.com/intent/tweet?text=myQuote
Stephen James
@sjames1958gm
Apr 07 2016 19:32
@ehekatlOf Did you get this code from somewhere?
abtak mustapha
@mustapha88
Apr 07 2016 19:33
@adzam5 whatever i put in ,?text="something"it return in twiteer something it doesn't copy the quote
ehekatlOf
@ehekatlOf
Apr 07 2016 19:35
yeah
it was from a stack conversation when I was looking up how to do smooth scrolling
if I can't figure out how it works by the end of today, I think I'll just comment it out
Stephen James
@sjames1958gm
Apr 07 2016 19:36
Is it supposed to select every <a> on the page
ehekatlOf
@ehekatlOf
Apr 07 2016 19:37
yeah
like I get the idea that it's supposed to find the closest element that matches the clicked href
and add a scrolling animation with the given 500 milliseconds down to that position
Jessie
@jvhensley
Apr 07 2016 19:44
hello everyone! i finished my random quote generator, and everything is working except for that, when i refresh the page, when i click the "Get Quote" button the first time, no data gets pulled from the API and i end up with empty quotation marks on my page. But on the second and all following clicks, it works fine. i've tried googling this many times, and have come up empty. please help!
https://codepen.io/jvhensley/pen/OMYmyX
ehekatlOf
@ehekatlOf
Apr 07 2016 19:48
hm that is weird
I added console.log(newquote); right after getdata();
and it's logging fine
Jessie
@jvhensley
Apr 07 2016 19:48
was it logging fine on the first click?
ehekatlOf
@ehekatlOf
Apr 07 2016 19:49
oh I see
you have it set up to console.log
from successful API call
yeah ok
it's spaghetti flow
that's why
Jessie
@jvhensley
Apr 07 2016 19:50
i don't know what that is
ehekatlOf
@ehekatlOf
Apr 07 2016 19:50
I had this problem on quite a few of my projects as well
Jessie
@jvhensley
Apr 07 2016 19:50
aha!
ehekatlOf
@ehekatlOf
Apr 07 2016 19:50
basically anytime you work with functions involving callbacks
the flow of your code is no longer topdown
it becomes spaghetti
you have to set restrictions to make it flow the way you want it to
Jessie
@jvhensley
Apr 07 2016 19:51
hm, ok
ehekatlOf
@ehekatlOf
Apr 07 2016 19:51
if you remove the console.log fields
from your successful API call
and try to console.log on your function after getdata()
like so console.log(newquote);
it'll show up as nothing
Jessie
@jvhensley
Apr 07 2016 19:52
and why does that happen?
ehekatlOf
@ehekatlOf
Apr 07 2016 19:52
because the function is happening before the API call happened
the flow is no longer top down
Jessie
@jvhensley
Apr 07 2016 19:53
i had a vague thought about that, but then i wasn't sure how to order things
and btw, thanks @ehekatlOf for your help!
CamperBot
@camperbot
Apr 07 2016 19:54
jvhensley sends brownie points to @ehekatlof :sparkles: :thumbsup: :sparkles:
:star: 245 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
ehekatlOf
@ehekatlOf
Apr 07 2016 19:54
yeah no problem
personally I'd just make make your click do a separate API call every time
that should fix it
I think
wait you're doing that
I'm bad, don't listen to me
Jessie
@jvhensley
Apr 07 2016 19:55
am i? i don't even know.
this is my first api and i'm very confused about the whole thing
i thought by defining getdata first, and then calling it, that was the right order.
Sephem
@Sephem
Apr 07 2016 20:01
Any advice or feedback would be appreciated
http://codepen.io/Sephem/full/EKbbQj/
ehekatlOf
@ehekatlOf
Apr 07 2016 20:02
ok
I fixed it
$(document).ready(function() {

var newquote = "";
var newauthor = "";

var getdata = function () { 
  $.ajax({
  url: 'https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous',
  type: 'POST',
  data: {},
  datatype: 'json',
  success: function(data) { 
    console.log(data);
    var apiobj = jQuery.parseJSON(data);
    console.log(apiobj);
    $(".quotehere").html("\""+apiobj.quote+"\"");
    $(".author").html("~ "+apiobj.author);
    $('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + encodeURIComponent('"' + newquote + '" -- ' + newauthor));    
  },
  error: function(err) { alert(err); },
  beforeSend: function(xhr) {
    xhr.setRequestHeader("X-Mashape-Authorization", "PpXH6lkRPmmshZ9Tn5HbzhMlNt05p14nt2OjsncBMHfwCuZei2"); //This is my personal Mashape key for this Application group
  }
});
  //end ajax header
};
//end getdata function

      $("#getquote").on("click", function(){
      getdata();            

   });
  //end getquote click function



});
//end document ready function
rouje
@rouje
Apr 07 2016 20:02
@jvhensley try putting your $(".quotehere").html("\""+newquote+"\""); . . . inside the success call. then call your getData() function after the declaration.
ehekatlOf
@ehekatlOf
Apr 07 2016 20:02
I stuck the HTML updates under the success function of $.ajax
and got rid of the intermediate containers
Jessie
@jvhensley
Apr 07 2016 20:03
omg, thank you so much! i think i had it set up that way at some point, but then changed it because something else wasn't working. you know how it is...
ehekatlOf
@ehekatlOf
Apr 07 2016 20:03
yeah, just remember
whenever you see a callback
your flow is now spaghetti
so console.log to find out where the tangle is
oh right, basically what @rouje said
abtak mustapha
@mustapha88
Apr 07 2016 20:04
help for button share in twiteer to pre populate a quote
CamperBot
@camperbot
Apr 07 2016 20:04
no wiki entry for: for button share in twiteer to pre populate a quote
Lucas Barbula
@lbarbula
Apr 07 2016 20:05
Hey my code is running and working but code camp won't let me pass the lever, how can I make it so?
Stephen James
@sjames1958gm
Apr 07 2016 20:05
@lbarbula Is it passing all the tests?
Jessie
@jvhensley
Apr 07 2016 20:05
which lesson is it?
nsloc22
@nsloc22
Apr 07 2016 20:05

@ehekatlOf Idk if this is correct but

scrollTop: $($.attr(this, 'href')).offset().top

This code is calling jquery method attr with two arguments this and 'href', then wraps returned element in jquery object and proceeds to do rest of the chained code.

I wouldn't look at it as nested selectors, and you could do the same with:

scrollTop: $(this.atrr('href')).offset().top
abtak mustapha
@mustapha88
Apr 07 2016 20:06
any one to help for how to pre populate quotes direct in twitter
ehekatlOf
@ehekatlOf
Apr 07 2016 20:07
this looks so much cleaner scrollTop: $(this.atrr('href')).offset().top lmao
thanks a lot @nsloc22
CamperBot
@camperbot
Apr 07 2016 20:07
ehekatlof sends brownie points to @nsloc22 :sparkles: :thumbsup: :sparkles:
ehekatlOf
@ehekatlOf
Apr 07 2016 20:07
you're awesome
CamperBot
@camperbot
Apr 07 2016 20:07
:star: 337 | @nsloc22 | http://www.freecodecamp.com/nsloc22
nsloc22
@nsloc22
Apr 07 2016 20:07
np
ehekatlOf
@ehekatlOf
Apr 07 2016 20:07
wow what a super roundabout way to do a selection
Jessie
@jvhensley
Apr 07 2016 20:08
@ehekatlOf , just curious, does the Twitter button still work with that solution you did on my quote generator?
ehekatlOf
@ehekatlOf
Apr 07 2016 20:10
didn't test it
Jessie
@jvhensley
Apr 07 2016 20:11
im
i'm not sure it'll work that way. i'm plugging in the code to try.
ehekatlOf
@ehekatlOf
Apr 07 2016 20:11
hm, strangely enough scrollTop: $(this.atrr('href')).offset().top doesn't work
but scrollTop: $($.attr(this, 'href')).offset().top does
Stephen James
@sjames1958gm
Apr 07 2016 20:12
@Sephem Nice jobs 1) clear button shouldn't appear until something to clear. 2) Submit should clear input field. Like the style
ehekatlOf
@ehekatlOf
Apr 07 2016 20:12
man, I don't even
Sephem
@Sephem
Apr 07 2016 20:12
@sjames1958gm great will impliment
ehekatlOf
@ehekatlOf
Apr 07 2016 20:17
so I guess the better question now is why does calling the .attr separately with 2 parameters, and then using that as a jquery selector works
but the only expected way of doing it doesn't
Sephem
@Sephem
Apr 07 2016 20:18
@sjames1958gm how is it now?
Stephen James
@sjames1958gm
Apr 07 2016 20:19
@Sephem The clear button is not appearing (did you remove). Also when you hit enter for the search, the search suggestions window doesn't go away.
Sephem
@Sephem
Apr 07 2016 20:22
@sjames1958gm clear should be fixed now
Stephen James
@sjames1958gm
Apr 07 2016 20:23
@Sephem Yep!
Sephem
@Sephem
Apr 07 2016 20:23
now to figure out the removeal of autocomlete
ehekatlOf
@ehekatlOf
Apr 07 2016 20:24
cheaty easy way
$('form').submit(false);
but then you have to define your form submit action elsewhere
nsloc22
@nsloc22
Apr 07 2016 20:29

@ehekatlOf yeah tought it worked

$($(this).attr('href')).offset().top

this works, I guess whatever it is returning it need to be wrap around jquery object so you can call offset().top on it,
no other way

ehekatlOf
@ehekatlOf
Apr 07 2016 20:30
man that's super weird
is there a resource I can read for better understanding on how this is even working?
nsloc22
@nsloc22
Apr 07 2016 20:31
that's just chained functions I guess
Sephem
@Sephem
Apr 07 2016 20:31
@sjames1958gm it might just be easier to disable the enter key for the search
nsloc22
@nsloc22
Apr 07 2016 20:31
can't call jquery function on returned html element in first part of the code
it needs to be wrapped in $()
ehekatlOf
@ehekatlOf
Apr 07 2016 20:32
oh hm
nsloc22
@nsloc22
Apr 07 2016 20:33
you're are getting <a> html element in both cases, then you make it jquery object
Stephen James
@sjames1958gm
Apr 07 2016 20:34
@Sephem is that a jqueryui function - autocomplete.
Sephem
@Sephem
Apr 07 2016 20:34
@sjames1958gm yeah it is
ehekatlOf
@ehekatlOf
Apr 07 2016 20:34
oh I see
ehekatlOf
@ehekatlOf
Apr 07 2016 20:35
I still feel shaky with the implementation
but the idea of the inner selector returning HTML makes sense to me now
oh ok
I see
the inner is returning the position of the HTML
and the outter selector is returning the actual position of the HTML element?
Sephem
@Sephem
Apr 07 2016 20:38

@sjames1958gm it was as simple as adding

$(".wikiSearch").autocomplete( "destroy" );

to the submit function

could have used destroy, close or disable
Stephen James
@sjames1958gm
Apr 07 2016 20:39
@Sephem :clap:
Sephem
@Sephem
Apr 07 2016 20:39
actualy close is best
destroy stops it from working anymore and disable would do the same
@sjames1958gm any other suggestions?
nsloc22
@nsloc22
Apr 07 2016 20:41
@ehekatlOf $() this is not outer selector, it just just making whatever is inside a jquery object
Stephen James
@sjames1958gm
Apr 07 2016 20:41
@Sephem - on the jqueryUI page there is usually a class that you can reference maybe $("ui-autocomplete").hide();
Sephem
@Sephem
Apr 07 2016 20:42
@sjames1958gm okay. Any other suggestions for my page?
fyi I used .close
nsloc22
@nsloc22
Apr 07 2016 20:52

@ehekatlOf you can read about it here https://api.jquery.com/Types/#jQuery

"Most frequently, you will use the jQuery() function to create a jQuery object. jQuery() can also be accessed by its familiar single-character alias of $()"

ehekatlOf
@ehekatlOf
Apr 07 2016 20:56
ahhh ok
nsloc22
@nsloc22
Apr 07 2016 20:56
and here https://api.jquery.com/Types/#Selector
"The selectors are a composition of CSS and custom additions"
ehekatlOf
@ehekatlOf
Apr 07 2016 20:56
time to do some reading
nice, thanks @nsloc22
bookmarking these
CamperBot
@camperbot
Apr 07 2016 20:56
ehekatlof sends brownie points to @nsloc22 :sparkles: :thumbsup: :sparkles:
:warning: ehekatlof already gave nsloc22 points
Igor Amelichev
@igoramelichev
Apr 07 2016 20:58
Hey guys, finally I'm done with the Portfolio challenge. Maybe someone could give it a quick look, or feedback. It's my first project with no experience at all, so it's not perfect haha. There's a couple things in particular that bug me and I'd like to adjust them but I haven't, since I don't know how. They both are in the "about" section - a photo and a text, In full screen/desktop view the photo is too big, so i'd like to make it look smaller and the text alignment is just wrong, there's too much empty space on the right. I tried to change '.col' but it didn't help. Any advice would be appreciated. Thanks! http://codepen.io/igoramel/full/jqYmmy/
Alex9911
@Alex9911
Apr 07 2016 21:08
Hi everyone! Anyone has build a tribute page? I just "arrived" on the tribute challenge and I would like to see some examples of yours to inspire myself.
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:10

need help.... I'm on the tic tac toe project, I hope you can understand my code

// generates possible states from a given game state
var Successors = function(state) {
    var moves = [],
        availableMoves = state.availableMoves.slice();

    this.possibleStates = availableMoves.map(function(cell) {
        moves.push(cell);

        var newState = new GameState(state);
        newState.board[cell] = newState.activePlayer;

        return newState;
    });
    this.moves = moves; // keep track of the cell selected for new state
    console.log(this.moves);
};

This function is changing the state object that i passed as argument, why so?

rouje
@rouje
Apr 07 2016 21:12
@igoramelichev change the class of the div with your text in the about part, insted of col-md-4 use col-md-8. here's a guide for bootstrap's grid system http://getbootstrap.com/examples/grid/ :smiley:
I'm trying to make a to-do list. how do I make a variable equal to the input?
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:14
@igoramelichev you can set the image size on the css by adding
img {
  width: /* you choose */;
  height: /* same here */;
}
for the text align @igoramelichev you can add the class text-center to the paragraph you want to be aligned
Having three issues: 1. navbar div - can't seem to get the bar to its normal size
  1. portfolio thumbnails are too big for the actual container; also, how do i get a second row?
BC
@Big-Country
Apr 07 2016 21:16
Just want to make sure I'm not way off base here...for the Portfolio project, should I know how to do everything just from the FCC lessons? Or should I be looking at outside resources in order to clarify how to do some of this stuff?
llylee
@llylee
Apr 07 2016 21:16
  1. after i added the navbar, my bottom contact footer is not clickable
and it has that weird overlay
Alex9911
@Alex9911
Apr 07 2016 21:17
@adzam5 That's a great one!
llylee
@llylee
Apr 07 2016 21:18
also, how do i change font colors within each div? I tried using style and changing <h3> to black, but it doesn't work
Alex9911
@Alex9911
Apr 07 2016 21:18
@adzam5 Thanks! That's a bit more advanced than the given example :)
CamperBot
@camperbot
Apr 07 2016 21:18
alex9911 sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 398 | @adzam5 | http://www.freecodecamp.com/adzam5
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:19

need help.... I'm on the tic tac toe project, I hope you can understand my code

// generates possible states from a given game state
var Successors = function(state) {
    var moves = [],
        availableMoves = state.availableMoves.slice();

    this.possibleStates = availableMoves.map(function(cell) {
        moves.push(cell);

        var newState = new GameState(state);
        newState.board[cell] = newState.activePlayer;

        return newState;
    });
    this.moves = moves; // keep track of the cell selected for new state
    console.log(this.moves);
};

This function is changing the state object that i passed as argument, why so?

@llylee add background-size: cover; on the css for the repeating backgrounds
what do you mean by normal size?
@Big-Country absolutely use other sources too to learn
llylee
@llylee
Apr 07 2016 21:23
@jlouiss since I put the nav bar within <div> it is the same size of each of the containers instead of being a bar at the top
disjfa
@disjfa
Apr 07 2016 21:25
@llylee dont add scripts and styles in the pen`s html. Add the css on the css tab
dont know where it goes wrong, but that is step 1
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:26
@llylee
div::not(first-child) {
  height: 100vh;
  margin: 0;
  opacity: 0.7;
}
and i would suggest you to move the styles from the head to the css, just to be more consistent :)
llylee
@llylee
Apr 07 2016 21:28
@disjfa @jlouiss Yeah, I did that initially, but I guess I must have some lag because the styles wouldn't translate until I put them in the pen. Transferring now! Thanks!
CamperBot
@camperbot
Apr 07 2016 21:28
llylee sends brownie points to @disjfa and @jlouiss :sparkles: :thumbsup: :sparkles:
:star: 366 | @jlouiss | http://www.freecodecamp.com/jlouiss
:star: 307 | @disjfa | http://www.freecodecamp.com/disjfa
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:28
you're welcome
llylee
@llylee
Apr 07 2016 21:28
@jlouiss Thank you! that not first-child worked, but now all my containers are different sizes
CamperBot
@camperbot
Apr 07 2016 21:28
llylee sends brownie points to @jlouiss :sparkles: :thumbsup: :sparkles:
:warning: llylee already gave jlouiss points
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:30
@llylee sorry, it was div:not(:first-child)
hm... i can't understand why it doesn't work...
Igor Amelichev
@igoramelichev
Apr 07 2016 21:33
@rouje @jlouiss Thank you!
CamperBot
@camperbot
Apr 07 2016 21:33
igoramelichev sends brownie points to @rouje and @jlouiss :sparkles: :thumbsup: :sparkles:
:star: 367 | @jlouiss | http://www.freecodecamp.com/jlouiss
disjfa
@disjfa
Apr 07 2016 21:33
@llylee cleaned it from the 100% height bugs http://codepen.io/disjfa/pen/WwdEWb
CamperBot
@camperbot
Apr 07 2016 21:33
:star: 308 | @rouje | http://www.freecodecamp.com/rouje
disjfa
@disjfa
Apr 07 2016 21:33
@jlouiss the div was one, the .image was 2. The font size to 100px was another thing
Pete
@petegarvin1
Apr 07 2016 21:37
@disjfa looks great! :D
Mark Little
@MarkBLittle
Apr 07 2016 21:38
Has anybody found a better way to get familiar with the Wiki API than their documentation? It seems really unorganized to me
llylee
@llylee
Apr 07 2016 21:39
@disjfa awesome, thanks!
CamperBot
@camperbot
Apr 07 2016 21:39
llylee sends brownie points to @disjfa :sparkles: :thumbsup: :sparkles:
:warning: llylee already gave disjfa points
Randy Goldsmith
@Dueldrawer8
Apr 07 2016 21:39
@MarkBLittle this is a hard one.. watched half the video.. reading the documentation.. still really dont know how to use it. I may youtube it or google it some more
Mark Little
@MarkBLittle
Apr 07 2016 21:40
I've tried YT and haven't really found much
nsloc22
@nsloc22
Apr 07 2016 21:40
@jlouiss I have few questions:
availableMoves = state.availableMoves.slice(); // check if this isn't returning undefined 

 this.moves = moves; // can you access moves in this scope?
Randy Goldsmith
@Dueldrawer8
Apr 07 2016 21:40
@MarkBLittle darn..
BC
@Big-Country
Apr 07 2016 21:42
thanks @jlouiss
CamperBot
@camperbot
Apr 07 2016 21:42
big-country sends brownie points to @jlouiss :sparkles: :thumbsup: :sparkles:
:star: 368 | @jlouiss | http://www.freecodecamp.com/jlouiss
Randy Goldsmith
@Dueldrawer8
Apr 07 2016 21:43
if you figure it out.. let me know lol
Mark Little
@MarkBLittle
Apr 07 2016 21:43
I'm also a little upset that they didn't cite any sources in the doc ;)
Jeff
@adzam5
Apr 07 2016 21:43
What would cause a page not to scroll?
Mark Little
@MarkBLittle
Apr 07 2016 21:43
@adzam5 do you have overflow set to hidden?
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:43
@nsloc22 i declare var moves = [] on the third line, availableMoves works correctly
@adzam5 a broken mouse LOL
Jeff
@adzam5
Apr 07 2016 21:44
@MarkBLittle That was it! Thanks!
CamperBot
@camperbot
Apr 07 2016 21:44
adzam5 sends brownie points to @markblittle :sparkles: :thumbsup: :sparkles:
:star: 276 | @markblittle | http://www.freecodecamp.com/markblittle
Mark Little
@MarkBLittle
Apr 07 2016 21:45
No problem, chief. Overflow can be tricky sometimes...
@adzam5 Were you trying to prevent horizontal scrolling? If that
If that's the case, try overflow-x: hidden;
nsloc22
@nsloc22
Apr 07 2016 21:49
@jlouiss can you post your state object code?
Jean Louis Salbego
@jlouiss
Apr 07 2016 21:51
@nsloc22
// minimax players, x starts first
var MAX = 'x',
    MIN = 'o';

// constructor for game states
var GameState = function(previousState) {
    this.board = ['', '', '', '', '', '', '', '', ''];
    this.activePlayer = MAX;
    this.opponent = MIN;
    this.depth = 0; // total moves, necessary utility assignment

    // constructs state from previousState, if defined
    if (previousState != undefined) {
        var p = previousState;
        this.board = p.board;
        this.activePlayer = p.opponent;
        this.opponent = p.activePlayer;
        this.depth = p.depth + 1;
    }

    // returns empty cells indexes
    this.availableMoves = this.board.map(function(cell, index) {
        if (cell == '')
            return index;
    });

    // checks if this is a terminal state
    this.isTerminal = function() {
        return willWin(this, this.activePlayer) ||
            willWin(this, this.opponent) ||
            this.availableMoves.length === 0;
    };
};
Pawan
@pawan92