These are chat archives for FreeCodeCamp/HelpFrontEnd

16th
Aug 2016
CompGeekGirl
@LisaRamos
Aug 16 2016 00:00
Okay, so I figured out my tribute page and was able to fit it to a mobile or tablet device. https://codepen.io/lisaramos/pen/wWNxZY
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 00:07

Code::

social #socialContainer {

text-align: center;
}

social #socialContainer ul {

float: left;
text-align: center;
}

social #socialContainer ul li {

float: left;
paddding-left: 10px;
list-style-type: none;
}

<footer>
<div id="myFooter" class="row col-lg-12 container-fluid">
<div id="myFooterLeft" class="row col-lg-6 text-center">
<h3 style="color: white; text-transform: uppercase">About This Page</h3>
<div style="color: white; font-size: 14px">Made with many Google Searches <span class="glyphicon glyphicon-search" aria-hidden="true"></span> and Forum Help <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span><br> by John F. Kirkpatrick
</div>
</div>
<div id="myFooterRight" class="row col-lg-6 text-center">
<div>
<h3 style="color: white; text-transform: uppercase">Around The Web</h3>
</div>
<div id="social" class="row">
<div id="socialContainer" class="row text-center">
<p>
<ul>
<li><a href="http://facebook.com/suncitywebdesigners/" target="_blank"><i class="fa fa-facebook"></i></a></li>
<li><a href="http://linkedin.com/" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<li><a href="https://plus.google.com/" target="_blank"><i class="fa fa-google-plus"></i> </a></li>
</ul>
</p>
</div>
</div>
</div>
</div>
</footer>

Still does not center the social icons!!
http://codepen.io/jfkirkpatrick/pen/rLoqOA/

Thx. John

TomInDev
@tomindev
Aug 16 2016 00:14
Hi guys, what is the best practice to embed a main logo of the page in html?
encount
@encount
Aug 16 2016 00:45
@tomindev you can use an image tag and surround it with a href to you homepage (as people often click the logo to go to main page)
Gary Siu
@GarySiu
Aug 16 2016 01:00
@tomindev What do you mean by "embed"?
Timbowser
@Timbowser
Aug 16 2016 01:12
@tomindev not sure what you mean by that.
Andy Truett
@andytruett
Aug 16 2016 01:25
@jfkirkpatrick Your social icons are nested in what elements? What other positioning techniques are you currently applying to those elements? Are those elements block or inline elements? Does text-align apply to block elements or inline elements, or both?
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 02:00
Andy, stopped for supper and the news. Hope I can answer your questions for you and if not the code is displayed above this info. The social icons are nested within <div><p><ul><li><a<i class. css style uses text-align: center. Hopefully the code extract above will answer those questions that I didn't. Thx John
Good nite, all. Back is the am.
TomInDev
@tomindev
Aug 16 2016 02:03
@encount @GarySiu @Timbowser Just simply mean add logo to a weppage but I've seen many techniquies like:
1.
<h1><a href="index.html">Logo</a></h1>
and for this, people hide the text logo and put background image

2.
<a href="index.html"><span>Logo</span></a>
and for this, they add background as logo and give a span element display:none to hide text "Logo"

and more and I don't know which should I use.
Jack Lyons
@JackEdwardLyons
Aug 16 2016 02:06

hi guys, im trying to chain together some JS but not having any luck... heres my code as is without my chaining attempt

function uniteUnique(arr) {

   var newArray = [];

    var args = [].slice.call(arguments) 

    newArray = args.reduce((prev, curr) => {
      return prev.concat(curr);
    });

    var answer = newArray.filter((elem, pos) => {
      return newArray.indexOf(elem) == pos;   
      });

    return answer;
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);

is it possible to chain the reduce and the filter into one?

```function uniteUnique(arr) {

var newArray = [];

var args = [].slice.call(arguments) 

newArray = args.reduce((prev, curr) => {
  return prev.concat(curr);
}).newArray.filter((elem, pos) => {
  return newArray.indexOf(elem) == pos;   
  });

```
is it possible to chain the reduce and the filter into one, i know the above in wrong?

Timbowser
@Timbowser
Aug 16 2016 02:09
took some extra time to finish this one off but it is done. http://codepen.io/tbowser/full/YWdQLj/
@tomindev your logo would usually be an image or a .svg file. Most times companies put their logo in the top left corner of the website and wrap use an anchor tag that takes you back to the index page.
Jerzz
@2cool4school
Aug 16 2016 02:17
Hey guys I was wondering if someone might could check out my wikiViewer codePen. I believe im making a successful api call but i cant output the data, i dont want an answer, just a general idea of what im doing wrong or maybe a resource that would be helpful, as im not that great at dealing with these api's thus far.. anyways heres the link: https://codepen.io/shipfaced/pen/Lkqmpd
Stephen James
@sjames1958gm
Aug 16 2016 02:18
@2cool4school Your input is in a form and it is trying to submit the form and resetting the page.
@2cool4school I believe
Jerzz
@2cool4school
Aug 16 2016 02:18
its most definitely in a form, is that bad?
Stephen James
@sjames1958gm
Aug 16 2016 02:19
@2cool4school Well you need to account for the fact that you are not submitting the form to a server.
Jerzz
@2cool4school
Aug 16 2016 02:20
@sjames1958gm I'm sorry, but I'm still lost.
Stephen James
@sjames1958gm
Aug 16 2016 02:20
@2cool4school You will need to add a parameter to your click handler that is the event object.
And then call .preventDefault() on it to prevent this default behaviour
A form is designed to be submitted to a backend server but you are trying to handle the form in js, you need to tell the browser to not do this default behavior
@2cool4school A form is good in that it handles pressing enter in the input form which you would have to handle explicitly.
Jerzz
@2cool4school
Aug 16 2016 02:22
@sjames1958gm What other methods could you use for handling the input?
@sjames1958gm Can I just NOT wrap the input in a form element?
@sjames1958gm I have subsequently determined that I can, in fact, not wrap it in a form element, and I get the desired data return. Thanks!
CamperBot
@camperbot
Aug 16 2016 02:24
2cool4school sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2642 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 16 2016 02:29
@2cool4school you will have to handle the enter key yourself - use keypress event. You may need to move you $.getJSON to a separate function callable by two handlers
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:08
When using APIs if the server script requires additional key/value pairs and/or the POST method are you then required to use the .ajax method instead of .getJSON?
I was using an API for the random quote generator which the server required a key be passed before it would give back the JSON data
I couldn't make it work with the .getJSON method
greg
@wearenotgroot
Aug 16 2016 03:13
@RandomlyRandom method is just GET not POST for most api
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:14
guess that's why they call it the getJSON method and not the postJSON method huh?
Andy Truett
@andytruett
Aug 16 2016 03:14

@jfkirkpatrick Yes, I looked over your code and hoped to lead you to the solution by having you think about the answers to my questions.

Your icons are within <li> tags. Are <li> tags able to be centered by the text-align property?

From MDN: The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements, only their inline content.

Again looking at MDN we see that the <li> tag has an element type of Block, so the text-align property will not align any <li> tags themselves, but any inline content placed within those tags.

I asked about what other positioning you have on your elements—your social <ul> and <li> tags have float:left properties. These are working against your desired outcome with your current setup.

One solution addressing this particular issue without rewriting too much of your code:

...

ul li {
  list-style-type: none;
  float: none;   /* or just delete this property altogether */
}

...

#social #socialContainer ul {
  float: none;   /* or just delete this property altogether */
  text-align: center;
}
#social #socialContainer ul li  {
  float: none;   /* or just delete this property altogether */
  paddding-left: 10px;
  list-style-type: none;
}

This will allow your text-align: center declaration to function as you expect.

If you have any questions as to why, ask away!

greg
@wearenotgroot
Aug 16 2016 03:15
@RandomlyRandom which api was it?
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:16
@wearenotgroot thanks. Have you been on here all day? lol
CamperBot
@camperbot
Aug 16 2016 03:16
randomlyrandom sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1365 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Aug 16 2016 03:16
@RandomlyRandom more or less
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:16
says it requires post method
greg
@wearenotgroot
Aug 16 2016 03:18
@RandomlyRandom oh ok then post it is :smile:
@RandomlyRandom use $.ajax so you can set the headers required as $.getJSON is shortened and have some setting set for you. $.ajax will allow you to tweak more settings
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:19
yeah thanks. that's what I ended up doing. It works and all but I hate that I spent so much time on it today. I found a different API earlier which used the get method and I had it finished but it would only give you one quote per day instead of everytime you clicked the button
greg
@wearenotgroot
Aug 16 2016 03:20
@RandomlyRandom which one? there is one that you can increase post_per_page then you'll get an array of quotes(then just do random index)
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:21
it was the first one that popped up
greg
@wearenotgroot
Aug 16 2016 03:22
@RandomlyRandom have you tried forismatic?
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:23
nope
greg
@wearenotgroot
Aug 16 2016 03:23
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:24
oh I think you sent that one to me earlier today and I couldn't figure out how to call the methods so I switched to that other one. Would I just append the getQuote method to the url?
greg
@wearenotgroot
Aug 16 2016 03:25
@RandomlyRandom yeah
var apiURL = "http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?";
RandomlyRandom
@RandomlyRandom
Aug 16 2016 03:26
nice. should have stuck with that one a little longer before giving up and going on to the next one lol. Oh well. Its done now. I appreciate all your help today
greg
@wearenotgroot
Aug 16 2016 03:27
@RandomlyRandom np
Ryan Williams
@Ryanwfile
Aug 16 2016 04:12
Can someone please help me with this code for the simon project. I am trying to have all of the lights light up clockwise for a little while upon finishing the game such that red lights up, then green, then yellow, then blue, then red again. Thank you for any help. The codepen link is http://codepen.io/Ryanwfile/pen/RRdwGk
for (var i=0;i<50;i++) 
     {
       var ending = function() 
       {
         var redlight = function()
         {
           $('#red').css('background-color',"#FF0000");
           setTimeout(buttons.red,250);
         }
         var greenlight = function()
         {
           $('#green').css('background-color',"#00FF00");
           setTimeout(buttons.green,250);
         }
         var yellowlight = function()
        {
          $("#yellow").css('background-color',"#FFFF00");
          setTimeout(buttons.yellow,250);
        }
         var bluelight = function(){
           $("#blue").css('background-color',"#0000FF");
           setTimeout(buttons.blue,250);
        }

       setTimeout(function() 
         { 
             redlight(); 
         },250 * (i));

          setTimeout(function() 
         { 
             greenlight(); 
         },500 * (i));

         setTimeout(function() 
         { 
             yellowlight(); 
         },750 * (i));

         setTimeout(function() 
         { 
             bluelight(); 
         },1000 * (i));
        }//ends ending function
       ending();
     }
buiphuking
@buiphuking
Aug 16 2016 04:19
@Ryanwfile
use class to do that, your code too complicate
Stee
@5t33
Aug 16 2016 04:32
So.... I seem to always have problems with the simplest html
I can't seem to be able to get 3 elements in the same row
using <div class = "row>

HTML:

<div class = "location">
    <h1>location will go here</h1>
</div>

<div class = "container">

  <div class ="row">

    <div class = "condition col-sm-4"> 
      condition 
    </div>

    <div class = "icon col-sm-4">
      <i> icon will go here </i> 
    </div>

    <div class = "icon col-sm-4">
      <button class="btn btn-primary" id = "temp">
        F&deg
      </button>
    </div>

  </div>
</div>

<div class = "geoButton">
  <button class = "btn btn-md" id = "geo">
      Click here to use your location
  </button>
</div>

CSS:

html, body {
  width: 100%;
  height: 100%;
  background-image: url("");
  background-attachment: fixed;
  background-position: right top;
}

.container {
  text-align: center;
  margin-top:20%;
}

.condition {



}
#icon {

}

.location {
  font-family:Comic Sans MS;
  font-size: 20px;


}
/*buttons */
#geo {
  background-color: white;
  text-align: center;

}

#temp, text{
  font-size:20px;
  padding-left: 5px;
  padding-right:4px;
  padding-top: 0px;
  padding-bottom: 0px;
}

.geoButton {
  text-align: center;
}
Greg Duncan
@GregatGit
Aug 16 2016 04:43
@5t33 are you doing this in code pen?
@5t33 Make sure you add bootstrap to the css and jQuery.js and bootstrap.js (in that order) to the javascript (in settings if you are using codepen
Greg Duncan
@GregatGit
Aug 16 2016 04:48
I pasted it in codepen and found once I added bootstrap to the css worked
Ethan Rose
@ethanrose
Aug 16 2016 05:20
Could some of you critique my Pomodoro Clock? :) If you could give me UI/UX pointers and styling and JS and basically anything that can make me a better programmer, I'd really appreciate it.. thank you so much! ;) http://codepen.io/aidansven/full/akXEXa/
MesQueProgrammar
@MesQueProgrammar
Aug 16 2016 05:49
don't have long press event
tzvety
@tzvety
Aug 16 2016 05:59
HI guys,
I need some help, please. I am building the Random Quote Machine project and I am having problems with the tweet btn. It gets the first Quote ready to be twitted but when a new quote is generated, the twitter btn doesn't change its attr. Can you please check what I am doing wrong?
Here is my pen:
https://codepen.io/tzvety/pen/pbYoLr
tzvety
@tzvety
Aug 16 2016 06:57
How did you build it?
Elbert Cortez
@trip16661
Aug 16 2016 07:16
@aidansven works really fine but i was expecting a bit more on the circles
i was expecting them to have a different kind of set up
Greg Duncan
@GregatGit
Aug 16 2016 07:30
tzvety
@tzvety
Aug 16 2016 07:34
@GregatGit thanks a lot
CamperBot
@camperbot
Aug 16 2016 07:34
tzvety sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 738 | @gregatgit |http://www.freecodecamp.com/gregatgit
texyh
@texyh
Aug 16 2016 08:26
Good morning people
am stuck on the whether app project
can i get help
Mohammad Mousa
@mmalnass
Aug 16 2016 08:29
Hello Guys, Anyone can guid me to free book/notes to help me learn html/css/js asap .I am a newbie coder. Thanx in advance
Elbert Cortez
@trip16661
Aug 16 2016 08:35
css= any post from https://css-tricks.com/
html codeacademy or any other weblike that will give u the basics
Greg Duncan
@GregatGit
Aug 16 2016 08:39
@mmalnass http://devdocs.io/
Mohammad Mousa
@mmalnass
Aug 16 2016 08:39
@trip16661@GregatGit Thanx ,but is there a note-pdf or word- for basics tags,elements and etc
CamperBot
@camperbot
Aug 16 2016 08:39
mmalnass sends brownie points to @trip16661 and @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @trip16661 |http://www.freecodecamp.com/trip16661
:cookie: 739 | @gregatgit |http://www.freecodecamp.com/gregatgit
Adam Dąbrowski
@a-dabrowski
Aug 16 2016 08:44
Hey guys, I'm having trouble using Wikipedia API. I'm sending request but it seems that i don't receive neither success nor failure status with my request based on my console.log entries. Can you take a look at my code and suggest the source of this problem?
Here's my code
function getWikiData(searchQuery){
  console.log(searchQuery);
  $.ajax({
    type: 'GET',
    url: 'https://.en.wikipedia.org/w/api.php?action=query&format=json&list=search&continue=&srsearch=' + searchQuery +'&srnamespace=&srlimit=10&srqiprofile=classic&srwhat=text&srprop=timestamp%7Csnippet',
    timeout: 1000,
    dataType: 'json',
    beforeSend: function(){
      console.log("Got to beforeSend phase");
if(typeof searchQuery=== undefined){
  //stop function
  console.log("Invalid input in query");
} 
    },

    success:function(data){
console.log(data);
     console.log(data.search);
      console.log("Great success!");
    },
    fail:function(){
      console.log("Great failure");
    },
     complete:function(){
      console.log("complete request")
    }
  });
}

$(document).ready(getWikiData("wikipedia"));
Elbert Cortez
@trip16661
Aug 16 2016 08:44
@mmalnass you might want to take a look at this www.w3schools.com
Sorin Ruse
@sorinr
Aug 16 2016 08:50
@a-dabrowski i think it is https://en.wikipedia.org not https://.en.wikipedia.org. remove the dot before en
Adam Dąbrowski
@a-dabrowski
Aug 16 2016 08:53
@sorinr thank you for that :) i deleted the dot, but it still doesn't get to success or fail statew
CamperBot
@camperbot
Aug 16 2016 08:53
a-dabrowski sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 665 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Aug 16 2016 08:53
@a-dabrowski can you post the link to your pen?
Shawn Pan
@shawnpanda
Aug 16 2016 08:59
Hey, everyone. I am looking into how to switch images according to user's mouse hover position. Could someone tell me what the best way to accomplish the effect is? An example is this where the model image changes according to the mouse position.
laststand0810
@laststand0810
Aug 16 2016 09:02

Hi, I got a situation in my pen here:
http://codepen.io/laststand0810/pen/AXYVrz?editors=1011

currently everything works fine (type sth in the box, click outside, a search for 20 first articles on wiki execute), but I would like to have it do the search every time i stop typing for a set of time (like 4s) without the need of clicking outside the textbox to notice I have done typing, how can I do that?

encount
@encount
Aug 16 2016 09:09
@shawniscool you could have x number of divs positioned within each over with their own ids - then use jquery mouse enter to swap the img scr - like http://stackoverflow.com/questions/540349/change-the-image-source-on-rollover-using-jquery
Adam Dąbrowski
@a-dabrowski
Aug 16 2016 09:13
philippabh
@philippabh
Aug 16 2016 09:18
Hi all. Has anyone else found with this weather API task and also the twitter API project before it that using Codepen interferes with the API call working?? For this weather one I'm unable to do the find location function because codepen isn't https and it seems to be doing things behind the scenes that interferes
I'm likely going to use a different method of doing the projects like these because codepen is making it a struggle to test
encount
@encount
Aug 16 2016 09:22
@philippabh use this http://ip-api.com/json - it work on http
@philippabh for geolocation that is
NixonRichard
@NixonRichard
Aug 16 2016 09:35
hi
labeebahmad414
@labeebahmad414
Aug 16 2016 09:35

When I run following in console:

/(b+)/i.exec("cdbbdbsbz")

I get this:

["bb","bb"]

Why two bb matched this? As there is only one bb, you know two adjacent b appear only once.

NixonRichard
@NixonRichard
Aug 16 2016 09:36
codepen.io/Ayanami_Rei/pen/jAJOKo
hi there
what s wrong with the js part ?
 function (json) {
    $("#results").html( JSON.stringify (json));
    var html = '';
  json.forEach(function(val) {
  var keys = Object.keys(val);
  html += "<div class = 'result result a'>";
  keys.forEach(function(key) {
    html += "<strong>" + key + "</strong>: " + val[key] + "<br>";
  });
  html += "</div><br>";

  });
mostly this part
Greg Duncan
@GregatGit
Aug 16 2016 09:57
@NixonRichard first you would get the keys
NixonRichard
@NixonRichard
Aug 16 2016 09:57
yes i think i got some keys
Greg Duncan
@GregatGit
Aug 16 2016 09:58
this line isn't needed
texyh
@texyh
Aug 16 2016 09:59
i have some problems with my whether app here is my pen
Stephen James
@sjames1958gm
Aug 16 2016 10:00
@texyh It helps if you say what the problems are.
Greg Duncan
@GregatGit
Aug 16 2016 10:02
@NixonRichard var key = Object.keys(json.query.search)
texyh
@texyh
Aug 16 2016 10:02
@sjames1958gm i am getting a response from the api,but i when i try updating my html it dosent work
NixonRichard
@NixonRichard
Aug 16 2016 10:04
oh yeah
Greg Duncan
@GregatGit
Aug 16 2016 10:04
@NixonRichard you don't even need to use Object.key() - in json.query.search is an array of 10 objects
Stephen James
@sjames1958gm
Aug 16 2016 10:05
@texyh You don't need to reparse the json in the response. delete that parse line and change the next
$('#country').text(response.sys['country']);
Greg Duncan
@GregatGit
Aug 16 2016 10:06
@NixonRichard $("#results").html( JSON.stringify (json.query.search[0]));
NixonRichard
@NixonRichard
Aug 16 2016 10:06
@GregatGit okay
Stephen James
@sjames1958gm
Aug 16 2016 10:09
@texyh Did you see my response above?
NixonRichard
@NixonRichard
Aug 16 2016 10:10
nice
texyh
@texyh
Aug 16 2016 10:11
@sjames1958gm mehn, it worked,been on this for 2days now
@sjames1958gm thanks man, you are great
CamperBot
@camperbot
Aug 16 2016 10:11
texyh sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2643 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
NixonRichard
@NixonRichard
Aug 16 2016 10:12
what s the challenge ? @texyh
Stephen James
@sjames1958gm
Aug 16 2016 10:12
@texyh :+1:
Greg Duncan
@GregatGit
Aug 16 2016 10:12
@texyh you spelt 'weather' wrong on your app
texyh
@texyh
Aug 16 2016 10:14
@sjames1958gm but if i may ask, why was the parse giving the error, i can remember doing it in the previous project,what is different in this?
NixonRichard
@NixonRichard
Aug 16 2016 10:14
 $.getJSON(url,

     function (json) {
    $("#results").html( JSON.stringify(json));
    var html = '';
  json.forEach(function(val) {
  var keys = Object.keys(json.query.search[0].snippet);
  html += "<div = 'result a result extract'>";
  keys.forEach(function(key) {
    html += "<strong>" + key + "</strong>: " + val[key] + "<br>";
  });
  html += "</div><br>";

  });
      $('#results').html(html);      
    });
});
texyh
@texyh
Aug 16 2016 10:15
@NixonRichard fixed, thanks
CamperBot
@camperbot
Aug 16 2016 10:15
texyh sends brownie points to @nixonrichard :sparkles: :thumbsup: :sparkles:
:cookie: 240 | @nixonrichard |http://www.freecodecamp.com/nixonrichard
Stephen James
@sjames1958gm
Aug 16 2016 10:15
@texyh I am not sure what happened before, but JSON.parse on an existing object doesn't work.
NixonRichard
@NixonRichard
Aug 16 2016 10:15
if i remove Objects.keys() what do i have to do with the key variable ?
thx @GregatGit
CamperBot
@camperbot
Aug 16 2016 10:15
nixonrichard sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 740 | @gregatgit |http://www.freecodecamp.com/gregatgit
Stephen James
@sjames1958gm
Aug 16 2016 10:16
@texyh This was the error in the console. VM1309:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
@texyh basically it did a toString on the response object that resulted in [object Object] which resulted in that error above
@texyh It is possible that before you were getting the raw JSON string from the API rather than parsed object here.
Greg Duncan
@GregatGit
Aug 16 2016 10:18
@NixonRichard your api returns json with all the data in json.query.search[0] to [9]
NixonRichard
@NixonRichard
Aug 16 2016 10:19
why
Greg Duncan
@GregatGit
Aug 16 2016 10:19
@GregatGit put this line in then look at your console console.log(json.query.search);
texyh
@texyh
Aug 16 2016 10:21
@sjames1958gm i will look out for that next time, thanks again
CamperBot
@camperbot
Aug 16 2016 10:21
texyh sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: texyh already gave sjames1958gm points
NixonRichard
@NixonRichard
Aug 16 2016 10:22
it says json s not defined
Stephen James
@sjames1958gm
Aug 16 2016 10:22
@texyh :+1:
Ferhat
@ferhotguy
Aug 16 2016 10:22
Question/Suggestion : Visually, in one page html what is the best option to sepererate div containers
NixonRichard
@NixonRichard
Aug 16 2016 10:22
@GregatGit
Bhushan Patil
@mrpatil007
Aug 16 2016 10:23
@ferhotguy wht
Ferhat
@ferhotguy
Aug 16 2016 10:23
Im creating div containers
they way look in one page html - like borderless
is there a trick to look nicer visually
Bhushan Patil
@mrpatil007
Aug 16 2016 10:24
Use well class
Stephen James
@sjames1958gm
Aug 16 2016 10:25
He is asking a design question not a coding question.
Ferhat
@ferhotguy
Aug 16 2016 10:25
ok Bhushan will try
Stephen ?
Bhushan Patil
@mrpatil007
Aug 16 2016 10:26
@sjames1958gm i know
Greg Duncan
@GregatGit
Aug 16 2016 10:26
@NixonRichard The data that your api returns isn't is missing some key things - a good description and the wikipedia page
philippabh
@philippabh
Aug 16 2016 10:26
thanks Julian @encount
CamperBot
@camperbot
Aug 16 2016 10:26
philippabh sends brownie points to @encount :sparkles: :thumbsup: :sparkles:
:cookie: 282 | @encount |http://www.freecodecamp.com/encount
NixonRichard
@NixonRichard
Aug 16 2016 10:27
@GregatGit yes ?
Stephen James
@sjames1958gm
Aug 16 2016 10:27
@ferhotguy I am not a design guy, wish I was. You can work with the padding and the margins to eliminate any borders.
Ferhat
@ferhotguy
Aug 16 2016 10:27
okay Stephen, thank you
NixonRichard
@NixonRichard
Aug 16 2016 10:27
u r chelsea s fan ?
the blue
Greg Duncan
@GregatGit
Aug 16 2016 10:28
Arsenal
NixonRichard
@NixonRichard
Aug 16 2016 10:28
ah
Ferhat
@ferhotguy
Aug 16 2016 10:29
adding well class to container seems to work - thank you
NixonRichard
@NixonRichard
Aug 16 2016 10:29
Wenger
Bhushan Patil
@mrpatil007
Aug 16 2016 10:29
@ferhotguy most welcome
Stephen James
@sjames1958gm
Aug 16 2016 10:30
@mrpatil007 Sorry I stepped in, misunderstood your response.
@NixonRichard I am a Chelsea fan.
Bhushan Patil
@mrpatil007
Aug 16 2016 10:30
@sjames1958gm oh don't say sorry have a happy coding :)
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 10:38
hi everyone I try to use geolocation stuff on code pen but it showing this error message in the console "getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz
Mostafa Syam
@pro-mos
Aug 16 2016 10:40
@claretyoung20 you can use https://codepen.io or use a location api such http://ip-api.com
Bhushan Patil
@mrpatil007
Aug 16 2016 10:40
@claretyoung20 actually geolocation api use secure protocol request
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 10:41
thanks @pro-mos @mrpatil007
CamperBot
@camperbot
Aug 16 2016 10:41
claretyoung20 sends brownie points to @pro-mos and @mrpatil007 :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @pro-mos |http://www.freecodecamp.com/pro-mos
:cookie: 212 | @mrpatil007 |http://www.freecodecamp.com/mrpatil007
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 10:42
i got it
Mohammad Albarmawi
@malbarmawi
Aug 16 2016 10:47
@claretyoung20 this problem because you are do ajax request via another site than yours try to use jquery ajax and give it jsonp inkstand of json
  $.ajax({
      dataType: "jsonp",
      url: url,
      success: function(e) {}
})
texyh
@texyh
Aug 16 2016 11:19
@sjames1958gm anyhelp on how to toggle btw Celsius and Fahrenheit
Bhushan Patil
@mrpatil007
Aug 16 2016 11:21
@texyh you need a formula fahrenheit = celsius * 1.8 + 32;
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 11:21
just creat a two button or radio box, then write a jquery function on what to when clicked on .....
texyh
@texyh
Aug 16 2016 11:21
@mrpatil007 i knw that, need help with the html
Bhushan Patil
@mrpatil007
Aug 16 2016 11:22
@claretyoung20 ya r8
shawonsky16
@shawonsky16
Aug 16 2016 11:24

Hello bros, I am beginner and making a tribute page.

<div class="thumbnail"><img src="http://www.thedailystar.net/sites/default/files/upload-2014/gallery/image/arts/kazi-nazrul-islam.jpg">
<div class="caption text-center">A drawing of Kazi Nazrul Islam</div>
</div>

Why the text inside the caption div appears very large?

Bhushan Patil
@mrpatil007
Aug 16 2016 11:26
@shawonsky16 no its look good
Sunday James
@Jamezslim90
Aug 16 2016 11:27
I need help:
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 11:28
@shawonsky16 try this <figcaption class="figure-caption">A caption for the above image.</figcaption>
shawonsky16
@shawonsky16
Aug 16 2016 11:28
@mrpatil007 how can I decrease the text sie
Bhushan Patil
@mrpatil007
Aug 16 2016 11:28
@Jamezslim90 which help
@shawonsky16 use css for that
Anna Koshyna
@Ann1297
Aug 16 2016 11:30
hi, guys! maybe t's a silly question, but i am a little bit lost. now i need to make a random qoute machine for a challange, but i don't know how to strat. i mean i don't know how to access qoutes. should i write them manually to my app or get them somewhere from the web? help me pleeese
the doer
@ewathedoer
Aug 16 2016 11:31
You can write a separate json file with them or use some ready quotes from API. @Ann1297
Bhushan Patil
@mrpatil007
Aug 16 2016 11:31
@Ann1297 use urs or on web quote thats not matter
the doer
@ewathedoer
Aug 16 2016 11:31
It all depends on you, there’s no requirement in user stories as far as I remember to use ready API
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 11:32
@Ann1297 copy and paste this in ur broswer to see the data seetings
Sunday James
@Jamezslim90
Aug 16 2016 11:32
This is my code : var mystr = ' FirstLine\n\SecondLine\\rThirdLine';
Stephen James
@sjames1958gm
Aug 16 2016 11:33
@Ann1297 if you construct your app correctly you can build the whole thing on an array of quotes and then later add in an API
Sunday James
@Jamezslim90
Aug 16 2016 11:33
Its related to the escape sequences in strings challenge
I submitted the code buts not working
texyh
@texyh
Aug 16 2016 11:38
please what is wrong with this code```
Anna Koshyna
@Ann1297
Aug 16 2016 11:38
@ewathedoer @mrpatil007 @ewathedoer @claretyoung20 @sjames1958gm thanks for advise
CamperBot
@camperbot
Aug 16 2016 11:38
:cookie: 459 | @ewathedoer |http://www.freecodecamp.com/ewathedoer
ann1297 sends brownie points to @ewathedoer and @mrpatil007 and @claretyoung20 and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2647 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
texyh
@texyh
Aug 16 2016 11:38
$.getJSON("http://ip-api.com/json", function(data) {
console.log(data.country)
});```
CamperBot
@camperbot
Aug 16 2016 11:38
:cookie: 264 | @claretyoung20 |http://www.freecodecamp.com/claretyoung20
:cookie: 215 | @mrpatil007 |http://www.freecodecamp.com/mrpatil007
texyh
@texyh
Aug 16 2016 11:38
 $.getJSON("http://ip-api.com/json", function(data) {
     console.log(data.country)
 });
please what is wrong with this code
Timbowser
@Timbowser
Aug 16 2016 11:48
@texyh looks fine with the exception of no ; after your console.log. Do you have jquery enabled on your codepen?
I ran it in my pen with jquery enabled and I got a correct console.log
Hassan Rasool
@hassanrasool
Aug 16 2016 11:56
i have to "Build a Tribute Page" at this stage i am stuck with the concept. how can i create a concept for webpage and also how can i find resources for creating responsive site?
Janine vN
@janine9vn
Aug 16 2016 11:57
@hassanrasool Bootstrap will be your go to I think for responsive, I think they covered it in the lessons at that point
Hassan Rasool
@hassanrasool
Aug 16 2016 11:58
@janine9vn thanks for the response. i have gone through that. but i don't have a design for a webpage in my mind. also the images and videos to add in the page
CamperBot
@camperbot
Aug 16 2016 11:58
hassanrasool sends brownie points to @janine9vn :sparkles: :thumbsup: :sparkles:
:cookie: 347 | @janine9vn |http://www.freecodecamp.com/janine9vn
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 11:58
@hassanrasool yh bootstrap is great you can check out the tutorial on w3schools.com
Janine vN
@janine9vn
Aug 16 2016 11:59
Just start getting the content and figure out the best way to display the information and work from there. You have to start somewhere
Hassan Rasool
@hassanrasool
Aug 16 2016 11:59
@claretyoung20 yup i have checked it out already
@janine9vn i can develop a page on some guidelines but can't some page from scratch. not a kind of creater
How do I move the 'developer extraordinaire' text to the level of the pulpit?
the doer
@ewathedoer
Aug 16 2016 12:03
@Socs2708 you may try with position fixed and media queries for different screens later
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:09
@Socs2708 check this out by puting this in ur css .col-lg-5{
margin-top:550px;
}
Emmanuel Sekyi
@theSekyi
Aug 16 2016 12:09
@claretyoung20 thanks
CamperBot
@camperbot
Aug 16 2016 12:09
socs2708 sends brownie points to @claretyoung20 :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @claretyoung20 |http://www.freecodecamp.com/claretyoung20
Emmanuel Sekyi
@theSekyi
Aug 16 2016 12:10
You from Nigeria?
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:10
yes but I live in Vietnam
Emmanuel Sekyi
@theSekyi
Aug 16 2016 12:11
Your name gave you out.
Great to see you here. I'm from Ghana
Ken Haduch
@khaduch
Aug 16 2016 12:14
@Socs2708 @claretyoung20 - one problem with doing that is that :point_up: August 16, 2016 8:09 AM you will change one of the bootstrap classes & make it difficult to have a responsive site. It looks like you have that text "Developer Extraordinaire" as part of the banner? Maybe you need to start by moving it out of the banner and then you can try to place it on the page in a different location?
This is what I did, I decided to put it in 'developer' class
How about that?
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:17
i think is good u can desing the div
Emmanuel Sekyi
@theSekyi
Aug 16 2016 12:22
I can design the div?
texyh
@texyh
Aug 16 2016 12:22
@ewathedoer yh it does
lackodan
@lackodan
Aug 16 2016 12:25
Hey guys. I'm having trouble with my portfolio site: https://codepen.io/lackodan/pen/XKOArG (just placeholder text and images for now). For starters, could anyone explain how to vertically center the images in the "Portfolio" section?
Milos
@Milos2709
Aug 16 2016 12:40
Hey there guys :)
Is anyone there to help me with Random Quote machine? :)
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:41
sure
texyh
@texyh
Aug 16 2016 12:42
please who has used this http://ip-api.com/ API
Arti M
@artismarti
Aug 16 2016 12:44
Hi all, I'm going through the Bootstrap column exercises
<div class=“col-xs-6”>
So I get how this works.
What I want to understand is how do you create this so it's responsive?
I mean xs is for smaller screens
How do you code it so that when it's a larger screen it uses col-md-6 rather than col-xs-6
Milos
@Milos2709
Aug 16 2016 12:46

@claretyoung20
I used this code:

$(document).ready(function(){
  $("#newquote").on("click",function(){
    $.getJSON("http://quotesondesign.com/wp-json/posts? filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
      $("#quote").html(a[0].content);
      $("#author").html(a[0].title);
    });
  });  
});

When I click the button, I do get the quote and author from the API. However, if I click the button again, I can't get another quote. How should I do this, any tips? :)
unfinished pen here
http://codepen.io/Milos2709/pen/LkqXLW?editors=0010

Paul Borawski
@iAmNawa
Aug 16 2016 12:46
Will someone look under my works in progress under the photos https://paulborawski.com …I want to style the words I’m just not sure what to do
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:49
@Milos2709 you have creat a function so that wen u click on the button it will call the function
Paul Borawski
@iAmNawa
Aug 16 2016 12:50
@Milos2709 It seems like you are getting the same quote every first click
Ken Haduch
@khaduch
Aug 16 2016 12:50
@artismarti - just try using col-md-6in addition to col-xs-6 - you can use multiple classes on an element class="col-xs-6 col-md-6" (if you didn't know that.)
Young Mary-Claret Nnenna
@claretyoung20
Aug 16 2016 12:51
see an example $("#gQuote").click(function() {
$.getJSON(url, setQuote, 'jsonp');
});
setQuote is the function
Milos
@Milos2709
Aug 16 2016 12:51
@claretyoung20 @iAmNawa Yes, but how can I get a random quote? When I go directly to the API url, it's always a different quote. I don't know what I did wrong :/
Very new to APIs btw. :D
Thanks @claretyoung20 I'll try that
CamperBot
@camperbot
Aug 16 2016 12:52
milos2709 sends brownie points to @claretyoung20 :sparkles: :thumbsup: :sparkles:
:cookie: 268 | @claretyoung20 |http://www.freecodecamp.com/claretyoung20
the doer
@ewathedoer
Aug 16 2016 12:53
@iAmNawa very interesting project, not sure what you want to get, what yopu struggle with now but maybe first you should be consistent and if you write about yourself in the 3rd person do not mix it with contact ME. Another thing you may do with text is to get rid of dots after summary and play with typo making some words in bold or a separate box of text
This is when it comes to about section
In portfolio maybe instead of technologie names you can provide some description of the process and the way you went to build it or add tech logos instead of raw names
Arti M
@artismarti
Aug 16 2016 12:54
@khaduch Ah! So it will automatically choose the right class given the size of the screen?
Ken Haduch
@khaduch
Aug 16 2016 12:54
@Milos2709 - it looks like it is just getting the quote from the browser cache? If you look at the example on the http://quotesondesign.com/api-v4-0/ - the "simple example" - they use $.ajax and set cache: false
@artismarti - yes, that's the idea.
Arti M
@artismarti
Aug 16 2016 12:55
Awesome. Thank you for your help, @khaduch
CamperBot
@camperbot
Aug 16 2016 12:55
artismarti sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1548 | @khaduch |http://www.freecodecamp.com/khaduch
Milos
@Milos2709
Aug 16 2016 12:55
Thank s @khaduch , that seems enlightening! Might help me work this out :)
CamperBot
@camperbot
Aug 16 2016 12:55
milos2709 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1549 | @khaduch |http://www.freecodecamp.com/khaduch
the doer
@ewathedoer
Aug 16 2016 12:55
@iAmNawa the picture in the top section is great but distracts from the text, what about making it blended?
Paul Borawski
@iAmNawa
Aug 16 2016 12:57
@ewathedoer That makes sense, to talk about myself in the third person but then say contact me. Thanks for input. I don’t understand what play with typo means though?
CamperBot
@camperbot
Aug 16 2016 12:57
iamnawa sends brownie points to @ewathedoer :sparkles: :thumbsup: :sparkles:
:cookie: 461 | @ewathedoer |http://www.freecodecamp.com/ewathedoer
the doer
@ewathedoer
Aug 16 2016 12:58
@iAmNawa by play with typo I mean try changing it in css, experimenting
Paul Borawski
@iAmNawa
Aug 16 2016 12:58
@ewathedoer changed it to contact him
the doer
@ewathedoer
Aug 16 2016 12:59
maybe contact Paul ;)
Ken Haduch
@khaduch
Aug 16 2016 12:59
@artismarti - you're welcome - it is interesting to look at the CSS for those grid column settings, the CSS selectors are very long, naming all of the related classes. Probably would help to understand that, too. (I mean, help me, to understand it...)
@Milos2709 - you're welcome - I hope that works out!
Paul Borawski
@iAmNawa
Aug 16 2016 12:59
@ewathedoer changing what in css?
the doer
@ewathedoer
Aug 16 2016 13:00
fonts @iAmNawa
Paul Borawski
@iAmNawa
Aug 16 2016 13:00
@ewathedoer changed it to contact Paul. thanks again
CamperBot
@camperbot
Aug 16 2016 13:00
iamnawa sends brownie points to @ewathedoer :sparkles: :thumbsup: :sparkles:
:warning: iamnawa already gave ewathedoer points
Paul Borawski
@iAmNawa
Aug 16 2016 13:00
You are very helpful
Milos
@Milos2709
Aug 16 2016 13:00
@khaduch Thanks! It did work out, I fixed the cache. Now on to fiddling with Twitter share and that would be it. Thanks again!
CamperBot
@camperbot
Aug 16 2016 13:00
milos2709 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: milos2709 already gave khaduch points
Paul Borawski
@iAmNawa
Aug 16 2016 13:02
@ewathedoer Which font do you not like?
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:03

function truthCheck(collection, pre) {
for (var i = 0; i < collection.length; i++) {

if (collection[i])
return true;
else
return false;

}
}

truthCheck([{"single": "yes"}], "single");

the doer
@ewathedoer
Aug 16 2016 13:03
@iAmNawa I’m not good at it, I usually go for google fonts, depending on the project and character of the project; you can search them here: https://fonts.google.com/
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:04
Since I cant seem to get the code pasting working right on my phone, this is what I got on the Everything Be True problem
Mostafa Syam
@pro-mos
Aug 16 2016 13:04
@iAmNawa maybe put the words in vertical rectangles with deferent colors for each word?
Paul Borawski
@iAmNawa
Aug 16 2016 13:04
@ewathedoer I meant which font on my site do you think should be changed?
@pro-mos Thanks
CamperBot
@camperbot
Aug 16 2016 13:05
iamnawa sends brownie points to @pro-mos :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @pro-mos |http://www.freecodecamp.com/pro-mos
Mostafa Syam
@pro-mos
Aug 16 2016 13:05
@iAmNawa also the links on the images give them target="_blank"
Paul Borawski
@iAmNawa
Aug 16 2016 13:06
@pro-mos which images?
the doer
@ewathedoer
Aug 16 2016 13:06
and what’s the problem you are fighting with now to answer it properly? @iAmNawa You should feel your page best as its creator and the person about whom it is, I’d suggest stressign the words that your clients may look for scanning the text quickly
Mostafa Syam
@pro-mos
Aug 16 2016 13:06
portfolio ones
Paul Borawski
@iAmNawa
Aug 16 2016 13:07
@pro-mos Those links are working on my end?
@ewathedoer That makes a lot of sense, I really appreciate your input
Mostafa Syam
@pro-mos
Aug 16 2016 13:08
@iAmNawa i know, i mean, make them open in a new tab instead opening over your website
the doer
@ewathedoer
Aug 16 2016 13:08
glad it helps :) @iAmNawa
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:08
I have tried adding [pre] to the if statement but it doesnt seem to work
Arti M
@artismarti
Aug 16 2016 13:12
@iAmNawa Have to agree with @ewathedoer - the color scheme on the top image is clashing with the color of your text
So it makes it hard to read
Maybe you can try to make the font much thicker?
Paul Borawski
@iAmNawa
Aug 16 2016 13:13
@artismarti thanks… I think you guys might be right
CamperBot
@camperbot
Aug 16 2016 13:13
iamnawa sends brownie points to @artismarti :sparkles: :thumbsup: :sparkles:
:cookie: 91 | @artismarti |http://www.freecodecamp.com/artismarti
Arti M
@artismarti
Aug 16 2016 13:13
& also maybe try making the image greyscale
Paul Borawski
@iAmNawa
Aug 16 2016 13:14
What color would you suggest for the text
Arti M
@artismarti
Aug 16 2016 13:14
look at this: nativebrews.in
even though the color scheme is black, white & grey shades - you can read the text easily
So you can keep the text color the same, but maybe change the image to a less distracting one
Paul Borawski
@iAmNawa
Aug 16 2016 13:16
I actually don’t think that native brews fits well with that background
Arti M
@artismarti
Aug 16 2016 13:17
You mean the font?
Paul Borawski
@iAmNawa
Aug 16 2016 13:17
No I mean it doesn’t stick out enough, it’s not prominent
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:19
I could really use help on this one, I am almost positive it has to do with the "pre" parameter
Paul Borawski
@iAmNawa
Aug 16 2016 13:25
@BlackSuitAndroid how can I help?
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:26
function truthCheck(collection, pre) {
for (var i = 0; i < collection.length; i++) {
if (collection[i][pre])
return true;
else
return false;
}
}
truthCheck([{"single": "yes"}], "single");
This is the Everything Be True problem
Im just not sure what my issue is
I think I am using the "pre" parameter wrong
Also sorry the code isnt in the black box, I dont know how to do it on the app
Ken Haduch
@khaduch
Aug 16 2016 13:31
@BlackSuitAndroid - you should probably have the .hasOwnProperty() method in there to make sure that the object you are working with actually has the property before trying to use it.
Paul Borawski
@iAmNawa
Aug 16 2016 13:34
isn’t it if() {return true;} else {return false;}
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 13:36
@iAmNawa FCCs code editor doesnt mark it as wrong the way I typed it so I dont think it matters?
Oh and @khaduch well that would tell me if it exists, true, but my real problem I think is actually accessing the values I need to test in the first place
manoj kumar
@manojpenworks
Aug 16 2016 13:48
hello world
CamperBot
@camperbot
Aug 16 2016 13:48

welcome to FreeCodeCamp @manojpenworks!

Ken Haduch
@khaduch
Aug 16 2016 13:48
@BlackSuitAndroid - oh... I think that the problem is that you should only return false as you are going through the list of objects, because if you return true as soon as you hit the first true case, you could miss things that should be false - so you have to reverse the type of test that you are doing. Just by making one small change to your code, I got all but one of the tests to pass. (Well, maybe I made more than one small change...)
manoj kumar
@manojpenworks
Aug 16 2016 13:49
hello, i found about Free Code Camp article in medium. i am interested in data visualization.
helloworld! , i found about Free Code Camp article in medium. i am interested in data visualization
greg
@wearenotgroot
Aug 16 2016 13:52
@texyh did you solved it?
Ken Haduch
@khaduch
Aug 16 2016 13:53
@BlackSuitAndroid - so, what I'm getting at, is that if you do not have the property, return false. Or if you have the property and the value is not "truthy", return false. Otherwise, after you look at all of the elements in the array, if none of them caused you to return false, then you return true. And using collection[i][pre] is the correct way to access the properties in the objects.
texyh
@texyh
Aug 16 2016 13:53
@wearenotgroot yes i did, and in another mess
greg
@wearenotgroot
Aug 16 2016 13:54
@texyh remember $.getJSON is asynchronous, meaning the data response from the api is not guaranteed to be delivered immediately
texyh
@texyh
Aug 16 2016 13:55
@wearenotgroot how?
@wearenotgroot yes i noticed,but its giving failed to load resource error
greg
@wearenotgroot
Aug 16 2016 13:56
@texyh it's working fine here
texyh
@texyh
Aug 16 2016 13:59
@wearenotgroot everybody is saying its working fine in theirs,so y is my pen not working in mine
@wearenotgroot how can i show u my console
greg
@wearenotgroot
Aug 16 2016 13:59
@texyh grab a screen shot? drag and drop into the chat?
@texyh btw do you have adblock? maybe that what is causing it
texyh
@texyh
Aug 16 2016 14:01
am using chrome
@wearenotgroot am using chrome
@wearenotgroot i dont,am thinking its because of my location
greg
@wearenotgroot
Aug 16 2016 14:03
@texyh hmm
@texyh try another browser then? or is it the same with every other browser?
greg
@wearenotgroot
Aug 16 2016 14:15
@texyh anyways going to have dinner. hope you find a solution to the error. GL
texyh
@texyh
Aug 16 2016 14:16
https://srv.buysellads.com/ads/CVAD4K7N.json?callback=CPAdsinsertAd&forward…0.12.253&callback=jQuery21108674090838306079_1471356920769&_=1471356920770 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
http://ip-api.com/json Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
@wearenotgroot getting this error in another browser
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:24
@khaduch Hey are you still online? I revised my code a little but I think I still have an issue
function truthCheck(collection, pre) {

  for (var i = 0; i < collection.length; i++) {

    if (collection[i].hasOwnProperty(pre) === false)
      return false;
    else if (collection[i][pre] === false)
      return false;
    else
      return true;

  }
}

truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex");
Abhisek Pattnaik
@abhisekp
Aug 16 2016 14:25
.
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:29
Or anyone else could assist as well, this problem seems like it would be so easy but its not for whatever reason
Ken Haduch
@khaduch
Aug 16 2016 14:32
@BlackSuitAndroid - yes - you should not be returning true from within the for loop - if you have done the lesson with the contacts, it is the same principle. You cannot return the final answer until you have examined all of the objects. Just move the return true; outside of the closing brace for the for loop (and take away that else that precedes it.)
Josh Werner
@jshwrnr
Aug 16 2016 14:32
When I click on a button that has :hover effects and the button moves, the :hover effects are still active even though my mouse is no longer hovering over the button. Does anyone know how to fix this problem?
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:33
Ohhhhhh I totally get my mistake now
Thank you @khaduch
CamperBot
@camperbot
Aug 16 2016 14:33
blacksuitandroid sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1550 | @khaduch |http://www.freecodecamp.com/khaduch
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:34
Okay, so that got me more checkmarks but not all of them
I think some of the false scenarios are passing through
I dont think if (collection[i][pre] === false) is working, I don't think it counts NaN and Null and "" as false
Stephen James
@sjames1958gm
Aug 16 2016 14:38
@BlackSuitAndroid Maybe just if (!collection[i][pre] ) return false;?
Ken Haduch
@khaduch
Aug 16 2016 14:40
@BlackSuitAndroid - I was going to recommend the same things as @sjames1958gm - just use the !
Meet Mangukiya
@meetmangukiya
Aug 16 2016 14:46
>>> print(re.match(r'(https://)?((youtube.com\/)|youtu.be\/)(\w*)', "https://www.youtube.com/watch?v=dvgZkm1xWPE"))
None
>>> print(re.search(r'(https://)?((youtube.com\/)|youtu.be\/)(\w*)', "https://www.youtube.com/watch?v=dvgZkm1xWPE"))
<_sre.SRE_Match object; span=(12, 29), match='youtube.com/watch'>
Sorry for that guys :(
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:53
Alright @khaduch and @sjames1958gm that made it so all my "false" outcomes came out right
But now all the true ones dont :P
Stephen James
@sjames1958gm
Aug 16 2016 14:54
@BlackSuitAndroid Give us a look see at the current code.
Ken Haduch
@khaduch
Aug 16 2016 14:57
@BlackSuitAndroid - yes - please show the code!
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 14:58
function truthCheck(collection, pre) {

  for (var i = 0; i < collection.length; i++) {

    if (collection[i].hasOwnProperty(pre) === false)
      return false;
    else if (!collection[pre])
      return false;
  }
  return true;
}

truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex");
greg
@wearenotgroot
Aug 16 2016 14:59
@texyh you need to call the weather() inside the callback function for ipinfo's $.getJSON
texyh
@texyh
Aug 16 2016 15:00
@wearenotgroot i dont get,please show me
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 15:01
Fixed it!!
greg
@wearenotgroot
Aug 16 2016 15:01
@texyh put this entire thing inside the 'document ready'
$.getJSON("http://ipinfo.io/json", function(data) {
     var latlog = data.loc;
        var lg = latlog.split(',');
        lat = parseInt(lg[0]);
        longi = parseInt(lg[1]);
        console.log(lg);

     whether(lat,longi); //you can change the function whether to accept parameters 
 });
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 15:02
@sjames1958gm @khaduch All I did was forget to put [i] before the [pre] on the else if
Just had to specify!
Thank you @sjames1958gm
CamperBot
@camperbot
Aug 16 2016 15:02
:star2: 2652 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
blacksuitandroid sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Damian Barnes
@BlackSuitAndroid
Aug 16 2016 15:02
Thank you @khaduch
CamperBot
@camperbot
Aug 16 2016 15:02
blacksuitandroid sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: blacksuitandroid already gave khaduch points
Stephen James
@sjames1958gm
Aug 16 2016 15:02
@BlackSuitAndroid :+1:
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 15:04
Andy Truett@andytruett I appreciate your help as I was going crazy trying to get this fixed. I have researched text-align css on MDN and made your suggested changes. Unfortunately, the social icons are now centered but stacked vertically. Any further suggestions? http://codepen.io/jfkirkpatrick/pen/rLoqOA/
greg
@wearenotgroot
Aug 16 2016 15:04
@texyh or you can have the entire thing inside the whether function
function whether(){
 $.getJSON(...,function(data){
       $.ajax({
        .....
         });

  });  

}

$(document).ready(function(){
  whether();
})
texyh
@texyh
Aug 16 2016 15:10
@wearenotgroot can you see how i did it
greg
@wearenotgroot
Aug 16 2016 15:11
@texyh the entire $.ajax thing inside the $.getJSON callback
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 15:11
@andytruett I appreciate your help as I was going crazy trying to get this fixed. I have researched text-align css on MDN and made your suggested changes. Unfortunately, the social icons are now centered but stacked vertically. Any further suggestions? http://codepen.io/jfkirkpatrick/pen/rLoqOA/
greg
@wearenotgroot
Aug 16 2016 15:14
@texyh :+1:
Jason Luboff
@JLuboff
Aug 16 2016 15:14
@jfkirkpatrick use <ul class="list-inline">
Darrin
@ddschmitz
Aug 16 2016 15:15
Does the notification sound on the pomodoro clock example work for anyone?
I tried using the code as well and it didn't seem to work. Unless I used it wrong.
texyh
@texyh
Aug 16 2016 15:15
@wearenotgroot yeah, fixed it
Ken Haduch
@khaduch
Aug 16 2016 15:16
@jfkirkpatrick - this: <p class="text-align:center"> is not correct. You might use style="text-align:center"- but if you are using Bootstrap, then you should be able to use class="text-center", at least as far as that goes. There is something else wrong there, most likely.
texyh
@texyh
Aug 16 2016 15:16
hw was dinner
@wearenotgroot how was diiner
greg
@wearenotgroot
Aug 16 2016 15:16
@texyh was good :smile:
@texyh btw do not round off the lat and long or else the location will be way off
  var latlog = data.loc;
  var lg = latlog.split(',');
  var lat = lg[0]; //<----- parseInt removed
  var longi = lg[1]; //<------parseInt removed
Jakub Adamec
@jadamec16
Aug 16 2016 15:23
Hi guys, how can I enable gzip compression of files on my website? Thanks.
Andy Truett
@andytruett
Aug 16 2016 15:25
This message was deleted
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:25
hi everyone
can anyone help me with my personal portfolio assignment
Gen Kaan
@GenKaan
Aug 16 2016 15:25
looking to get some help with my Twitch.TV API challenge
Jason Luboff
@JLuboff
Aug 16 2016 15:26
@prakashyadav008 what do you need help with?
Gen Kaan
@GenKaan
Aug 16 2016 15:27
gotten it to work, just wanted to find a easy solution to add HTML classes for on/offline but managed to get some strange errors
texyh
@texyh
Aug 16 2016 15:27
@wearenotgroot o, thought i was converting it to integer
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:27
@JLuboff whenever i scroll down
the thumbnail images scroll over navigation bar
greg
@wearenotgroot
Aug 16 2016 15:28
@texyh you don't have to(and every little number afte the . is needed to have more accurate location)
Jason Luboff
@JLuboff
Aug 16 2016 15:28
@GenKaan not sure your issue (I just started working on my Twitch app myself), but if I may make one suggestion, I would change the colors you're using. The red with blueish text is hard on th eyes. Otherwise, its looking good :+1:
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:29
if i remove the col-md-3 class it works fine but when i add it the problem occurs
Gen Kaan
@GenKaan
Aug 16 2016 15:29
@JLuboff right now Im just trying to get everything to work, almost no effort is put into styling at this point
texyh
@texyh
Aug 16 2016 15:29
@wearenotgroot changed it,my location is still way off thought,loool,like 500km off
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:30
@JLuboff help
Jason Luboff
@JLuboff
Aug 16 2016 15:30
@prakashyadav008 I'm taking a look
greg
@wearenotgroot
Aug 16 2016 15:30
@texyh well the ipinfo data sometime is not accurate.
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 15:30
@khaduch Thx. Fixed error but the social icons are now stacked vertical
CamperBot
@camperbot
Aug 16 2016 15:30
jfkirkpatrick sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1551 | @khaduch |http://www.freecodecamp.com/khaduch
Jason Luboff
@JLuboff
Aug 16 2016 15:31
@jfkirkpatrick <ul class="list-inline"> try that
Gen Kaan
@GenKaan
Aug 16 2016 15:31
the strange part is the log is fine but the output in HTML is not working :confounded:
texyh
@texyh
Aug 16 2016 15:31
@wearenotgroot how long hve u been coding
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:32
@JLuboff ok.tell me if u find any thing
greg
@wearenotgroot
Aug 16 2016 15:32
@texyh oh still a student, this is just a hobby(studying Game Design)
texyh
@texyh
Aug 16 2016 15:32
@wearenotgroot but u code?
greg
@wearenotgroot
Aug 16 2016 15:33
@texyh yeah just learned js since january but took some classes on coding a while back
texyh
@texyh
Aug 16 2016 15:33
@wearenotgroot woow that great
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 15:33
@JLuboff Beautiful. Now my headache should go away. Been working on this for days!! Thx again. John
CamperBot
@camperbot
Aug 16 2016 15:33
jfkirkpatrick sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @jluboff |http://www.freecodecamp.com/jluboff
texyh
@texyh
Aug 16 2016 15:34
@wearenotgroot just started 2weeks ago
Andy Truett
@andytruett
Aug 16 2016 15:34
@jfkirkpatrick Sorry, forgot to put this on the first reply...
#social #socialContainer ul li  {
  display: inline-block;    /*  Add this! :)  */
  paddding-left: 10px;
  list-style-type: none;
}
greg
@wearenotgroot
Aug 16 2016 15:34
@texyh :smile:
texyh
@texyh
Aug 16 2016 15:34
@wearenotgroot FFC improved my front end, i knw python too
greg
@wearenotgroot
Aug 16 2016 15:34
@texyh :+1:
John F Kirkpatrick
@jfkirkpatrick
Aug 16 2016 15:36
@andytruett Got it. Thanks for everything
CamperBot
@camperbot
Aug 16 2016 15:36
jfkirkpatrick sends brownie points to @andytruett :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @andytruett |http://www.freecodecamp.com/andytruett
Jason Luboff
@JLuboff
Aug 16 2016 15:37
@prakashyadav008 Take a look at this: http://getbootstrap.com/components/#navbar I think it might have to do with the container for your navbar but look at the examples and try re-working it
prakash chandra yadav
@prakashyadav008
Aug 16 2016 15:38
the navbar should be fixed and i didnt used mostly css @JLuboff
@JLuboff when i remove the col class from the thumbnail images it works fine
Jason Luboff
@JLuboff
Aug 16 2016 15:44
@prakashyadav008 Sorry, I'm not sure then.
greg
@wearenotgroot
Aug 16 2016 15:47
@GenKaan when data.stream !== null you can to access data this way
          icon = data.stream.channel.logo;
          link = data.stream.channel.url;
          game = data.stream.channel.game;
          name = data.stream.channel.display_name;
          info = data.stream.channel.status;
Gen Kaan
@GenKaan
Aug 16 2016 15:48
@wearenotgroot thanks, changing some stuff right now
CamperBot
@camperbot
Aug 16 2016 15:48
genkaan sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: genkaan already gave wearenotgroot points
greg
@wearenotgroot
Aug 16 2016 15:51
@GenKaan what you can do is check for stream first then if the data.stream for a certain channel is null, you can use the links from the data as a url for the next $.getJSON call using /channel
Peter Kenward
@PeterKenward
Aug 16 2016 15:52
I have been stuck for a while. :( I am having problems with variable scope in the method myApp.data(); I should like to make the data generated in the success function of the getJSON method 'public'. I can't see how? http://codepen.io/Kontact/pen/YWJKXx/?editors=0010
Stephen James
@sjames1958gm
Aug 16 2016 15:55
@PeterKenward you could make it public, but realize that it wont be available until the callback is invoked. The callback will have to fill in the data.
anvarov
@anvarov
Aug 16 2016 15:57
hello, please check my random quote machine page, http://codepen.io/anvarov/pen/KMMpoL
Jason Luboff
@JLuboff
Aug 16 2016 15:57
@anvarov Looks good. I like the simplistic style
Peter Kenward
@PeterKenward
Aug 16 2016 15:58
@sjames1958gm I am okay with that...
anvarov
@anvarov
Aug 16 2016 15:58
@JLuboff thank you, bootstrap 4)
CamperBot
@camperbot
Aug 16 2016 15:58
anvarov sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 285 | @jluboff |http://www.freecodecamp.com/jluboff
anvarov
@anvarov
Aug 16 2016 15:58
alpha
Peter Kenward
@PeterKenward
Aug 16 2016 15:59
So could I just return(json) from the success function?
PeterKenward @PeterKenward is still confused as to how...
Sorin Ruse
@sorinr
Aug 16 2016 16:41
@anvarov what is the reason to use return false; in your function getQuote.onclick = function(){ ?
Patrick S
@thinktwice84
Aug 16 2016 16:42
Hey guys, so I'm having a little trouble with codepen. I'm trying to make a responsive, fixed navbar for the portfolio project, but the dropdown button isn't working upon resizing to mobile width. This pen is just a copy-paste from the bootstrap wiki so I can better explain what my problem is. If the code is run within the bootstrap website, the dropdown menu works fine upon resizing the page to mobile width. The codepen however, causes the dropdown button to fail upon resizing the page. Any idea why? I should mention I have bootstrap enabled in Codepen.
Sorin Ruse
@sorinr
Aug 16 2016 16:43
@thinktwice84 load jquery and after bootstrap in settings->javascript part
Patrick S
@thinktwice84
Aug 16 2016 16:44
Doesn't seem to change anything
There are no scripts in the HTML
Sorin Ruse
@sorinr
Aug 16 2016 16:45
@thinktwice84 and bootstrap after jquery :)
Patrick S
@thinktwice84
Aug 16 2016 16:46
THANK YOU!
I didn't realize I needed to activate bootstrap in CSS and JS
Jacob Stewart
@JacobStewart1
Aug 16 2016 16:50
https://codepen.io/JacobStewart1/pen/dXgNzw hey my wikipedia search isnt working can someone help me figure out how to fix it
Sorin Ruse
@sorinr
Aug 16 2016 16:50
@thinktwice84 welcome
@JacobStewart1 try: success: function(data){ console.log(data); } and you will see the response object in your console
Jefferson
@jeffersonnnn
Aug 16 2016 17:05
hi guys, i have what may look to be a rudimentary question. I do not understand what is meant by fufilling user stories. How do i do this.
Yuriy Medentsii
@hvuntokrul
Aug 16 2016 17:05
@jeffersonnnn you need to make your app work in such a way that one can do what is described in user stories with it
@jeffersonnnn if the user story says "I can add two numbers", then your program should be able to add two numbers
@jeffersonnnn or if "I can see an image and I can scroll it", then you should insert an image and make it scrollable I guess :)
Tyler Moeller
@TylerMoeller
Aug 16 2016 17:08
@JacobStewart1 Everything is working with your code, except you need to change your wikipedia url to use HTTPS and change the font color of #displayResult to use black text so you can see it.
(You can't access an API over HTTP when your web app is loaded over HTTPS)
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:10
Hey people! Can I have your feedback about the first section of my portfolio? https://codepen.io/gabrielshaad/full/BzLRdm/
Jefferson
@jeffersonnnn
Aug 16 2016 17:11
@hvuntokrul oh. my. word. Okay, i've got this. I understand user story #5 now. How is user story #4 supposed to work though. I need to process this.
Jason Luboff
@JLuboff
Aug 16 2016 17:11
@GabrielShaad Looking good so far. Only problem is the image is broken
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:12
One of the problems that I noticed so far is when I try rendering the page on a very huge resolution it doesn't look nice.
@JLuboff Oh really? It's loading here. I'll try to host the image in a different place.
Yuriy Medentsii
@hvuntokrul
Aug 16 2016 17:13
@jeffersonnnn user story no.4 from where?
Jason Luboff
@JLuboff
Aug 16 2016 17:13
@GabrielShaad What do you mean by huge resolution? My resolution is 1920 x 1200 and it looks good?
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:14
@JLuboff Hum, interesting... I tried using the Responsive Mode on Safari in 1920 x 1080.
@JLuboff Maybe it's bugging when it renders on the emulator.
Tyler Moeller
@TylerMoeller
Aug 16 2016 17:15
@GabrielShaad If you use 'container' instead of 'container-fluid' it will set the content to a fixed width. the 'container-fluid' class makes everything full width.
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:17
@TylerMoeller Awesome, thanks! The navbar is perfectly aligned now.
CamperBot
@camperbot
Aug 16 2016 17:17
gabrielshaad sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 754 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Aug 16 2016 17:17
no problem - keep up the good work
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:17
@TylerMoeller But the problem is with the text. It looks too high, as if there's no padding.
Tyler Moeller
@TylerMoeller
Aug 16 2016 17:18
@GabrielShaad Which text? It seems to look fine to me, but maybe I'm overlooking something
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:19
@TylerMoeller The "I am a Computer Science Student..." text.
Tyler Moeller
@TylerMoeller
Aug 16 2016 17:20
You could add a class to this div: <div class="col-md-7" id="about-text">, something like: <div class="col-md-7 intro-text" id="about-text"> and then assign a top margin in your css:
.intro-text {
  margin-top: 60px;
}
(Adjust the pixels as desired)
@GabrielShaad
Gabriel Alexandre
@GabrielShaad
Aug 16 2016 17:21
@TylerMoeller I'll try that. Thank you again!
CamperBot
@camperbot
Aug 16 2016 17:21
gabrielshaad sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: gabrielshaad already gave tylermoeller points
Rohin Rajan
@rohinrajan
Aug 16 2016 17:21
Hi i dont know if this has been asked could you please let me know where i can get the API for getting quotes?
Jason Luboff
@JLuboff
Aug 16 2016 17:22
@rohinrajan I didn't use an API, just created my own array of quotes
Rohin Rajan
@rohinrajan
Aug 16 2016 17:22
Oh this is for the project Random Quotes
@JLuboff thanks i thought we should create using API
CamperBot
@camperbot
Aug 16 2016 17:23
rohinrajan sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 286 | @jluboff |http://www.freecodecamp.com/jluboff
greg
@wearenotgroot
Aug 16 2016 17:23
@rohinrajan just google search free quote api, here is one http://forismatic.com/en/api/
Jason Luboff
@JLuboff
Aug 16 2016 17:23
@rohinrajan you can difinitely use an API if you'd like, but unlike the next three projects, its not required for this one if you don't want to use one
Rohin Rajan
@rohinrajan
Aug 16 2016 17:24
@wearenotgroot and @JLuboff thanks guys appreciate it
CamperBot
@camperbot
Aug 16 2016 17:24
rohinrajan sends brownie points to @wearenotgroot and @jluboff :sparkles: :thumbsup: :sparkles:
:warning: rohinrajan already gave jluboff points
:star2: 1368 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
greg
@wearenotgroot
Aug 16 2016 17:25
@rohinrajan :+1:
Mohamed Sharuk C M
@Sharuk06
Aug 16 2016 17:34
could some one help me on Building a Personal Portfolio Webpage ??
Jason Luboff
@JLuboff
Aug 16 2016 17:34
@Sharuk06 Its better to ask specific questions, i.e what do you need help with?
Jim
@hyperactivebiker
Aug 16 2016 17:56
Hi, I've finished my Tribute Page, How do I upload it to the forum?
Jason Luboff
@JLuboff
Aug 16 2016 17:57
@hyperactivebiker You can just post a link to your codepen
TractorMan
@TractorMan
Aug 16 2016 18:30
can anyone help with CORS? I've got the quote machine working locally but I have to use a chrome extension to allow CORS
Jason Luboff
@JLuboff
Aug 16 2016 18:31
You can attach that to the begging of your APU url (i.e https://crossorigin.me/http://myapi.api)
API*
Then make sure you're connecting via https for codepen
TractorMan
@TractorMan
Aug 16 2016 18:33
thank you!
Jason Luboff
@JLuboff
Aug 16 2016 18:34
I just reread my second sentence...lots of typos :smile: but I'm guessing you got the gist of it haha
TractorMan
@TractorMan
Aug 16 2016 18:41
if i didn't want to use that, how difficult it to code it in?
Jason Luboff
@JLuboff
Aug 16 2016 18:43
My understanding is you have to use a proxy of some sort to be able to have http traffic used over https. The alternative is getting an API that is issues via https
it doesn't work with https
crossorigin works once and then stops...
Jason Luboff
@JLuboff
Aug 16 2016 18:51
may I see your codepen?
Tyler Moeller
@TylerMoeller
Aug 16 2016 18:57
@TractorMan The Forismatic API requires a callback to work around the CORS issues. Try this URL: http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?
texyh
@texyh
Aug 16 2016 18:57
Please whats the url for wiki search
Tyler Moeller
@TylerMoeller
Aug 16 2016 18:58
@texyh Here's the documentation for the WikiMedia API: https://www.mediawiki.org/wiki/API:Main_page
Gregory Bilecki
@gbilecki
Aug 16 2016 18:59
can someone help me and tlel me why my jquery plugin isnt working on my site?
its sticky.js -- using it for a navigation toolbar
texyh
@texyh
Aug 16 2016 19:01
@TylerMoeller can only see that for main page,how can i search for article
Tyler Moeller
@TylerMoeller
Aug 16 2016 19:01
@texyh There are lots of ways to search for an article. It depends on what results you want to get back from the API. That link I sent you will tell you all your options.
For example, this is one way to do it, but you only get basic results back: https://www.mediawiki.org/wiki/API:Opensearch
Manoj
@Manoj-Fernando
Aug 16 2016 19:03
hey guys how to make a jumbotron to 100% height??
can anyone help?
the doer
@ewathedoer
Aug 16 2016 19:06
@Manoj-Fernando if you mean 100% of the viewport, have you tried height:100vh
?
TractorMan
@TractorMan
Aug 16 2016 19:08
@TylerMoeller thanks man will do
CamperBot
@camperbot
Aug 16 2016 19:08
tractorman sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 756 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
TractorMan
@TractorMan
Aug 16 2016 19:09
@JLuboff give me a minute and i will show you
Manoj
@Manoj-Fernando
Aug 16 2016 19:10
@ewathedoer yes i have tried.....it comes to 100% height only if i give html,body{ height:100%;} ......................but the problem is when i give like that when i resize my browser, elemets get overlapped and it's a mess
texyh
@texyh
Aug 16 2016 19:48
please i wan when the 'click for a random article' is clicked a new window should open with the url href='https://en.wikipedia.org/wiki/Special:Random here is my pen http://codepen.io/texyh/pen/zBboom
Jason Luboff
@JLuboff
Aug 16 2016 19:49
add target="_blank" to your a href element
texyh
@texyh
Aug 16 2016 19:53
@JLuboff href= "_blank"
Jason Luboff
@JLuboff
Aug 16 2016 19:54
@texyh no, <a href="mylink.html" target="_blank">Link text</a>
I looked at your code and it looks like you're using jquery to change the attribute of the class "ran" but since its a fixed link, I don't think you need any jquery for it? Why not just use the HTML for that link since it won't be changing?
<a href="https://en.wikipedia.org/wiki/Special:Random" class = 'ran' target ='_blank'>
That works fine
texyh
@texyh
Aug 16 2016 19:58
@JLuboff thanks man
CamperBot
@camperbot
Aug 16 2016 19:58
texyh sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
Aug 16 2016 19:59
:+1:
texyh
@texyh
Aug 16 2016 20:00
@JLuboff finding it difficult getting the search url for the api
Jason Luboff
@JLuboff
Aug 16 2016 20:02
The url setup was what I found most difficult. I would recomend reading through the API documentation along with searching google to get some ideas. I don't know that I'd be the best at explaining
James Sral
@jamessral
Aug 16 2016 20:09
Hey all. I'm having difficulty with the Wikipedia API. Right now my search only returns [object Object] because I need to move deeper in the returned object (which I'm only alerting for test purposes). The query itself is what is tripping me up. Any help? http://codepen.io/jamessral/pen/zqyqge?editors=0010#0
James Sral
@jamessral
Aug 16 2016 20:17
Actually you know what, I actually get how to use the API sandbox now, haha
Daniel
@DanielMW34
Aug 16 2016 20:26
Question: I am really struggling with my weather map and the $.getJSON() method. Would anyone be willing to look at my code and help troubleshoot what is going wrong with it? https://codepen.io/Daniel_Widrich/pen/VjgRqQ/
@jamessral do you know how to use the jQuery.getJSON() method?
Jason Luboff
@JLuboff
Aug 16 2016 20:32
@DanielMW34 Check your API key
Daniel
@DanielMW34
Aug 16 2016 20:33
@JLuboff grrrr..... I have been having trouble with their API keys. I have another one ready to go. Beyond that, did I seemingly use my $.getJSON() method and the corresponding functions correctly?
Jason Luboff
@JLuboff
Aug 16 2016 20:34
The $.getJSON method looks correct...I was getting confused why I wasn't seeing any return thats why I tried the whole url by itself in the browser
Daniel
@DanielMW34
Aug 16 2016 20:35
I added in a failure return "EPIC FAIL" if you look in the bottom left of the screen
updated with new API key I requested earlier today
still no success
@JLuboff
Jason Luboff
@JLuboff
Aug 16 2016 20:37
Ok, verified it likes that API key atleast...lets see
@DanielMW34 Alright here we go!
add http:// to the beginning of your APIdomain
Then, change codepen from https to http
Daniel
@DanielMW34
Aug 16 2016 20:41
done and done.... now I can see the JSON in a browser window if I cut and past the entire API address
but still .... EPIC FAIL
Jason Luboff
@JLuboff
Aug 16 2016 20:42
The EPIC FAIL is going to show regardless just due to how its placed in there
Daniel
@DanielMW34
Aug 16 2016 20:42
Yeah, I was just about to ask that
Jason Luboff
@JLuboff
Aug 16 2016 20:43
You'd have to use an If statement or something along those lines to have a success/fail like that (you'd have to ask someone more experienced then me as well)
Stephen James
@sjames1958gm
Aug 16 2016 20:43
@DanielMW34 You have reached the catch 22 of the weather task - in chrome you cannot get the location data if you connect over http://
And you cannot use http:// APIs if you connect over https://
An alternative for the location is to use an http:// API such as http://ip-api.com/json
Jason Luboff
@JLuboff
Aug 16 2016 20:44
or we can use https by appending https://crossorigin.me/ to our api url (but @sjames1958gm is a much smarter guy then me when it comes to these things :smile: )
Daniel
@DanielMW34
Aug 16 2016 20:44
Ok, so I really am lost when it comes to the .getJSON method... like, where does this JSON go once we get it? Because I can't seem to figure that part out AND, in the random quote exercise, I pulled my data in jsonp which, as part of the api address, had in it a place where I designated the jsonp function name to wrap the data in... so no help there
Stephen James
@sjames1958gm
Aug 16 2016 20:45
If you want to continue to use browser location (much more accurate) do what @JLuboff says
Daniel
@DanielMW34
Aug 16 2016 20:45
@sjames1958gm and @JLuboff .... can we start with the above question on .getJSON ?
Jason Luboff
@JLuboff
Aug 16 2016 20:45
@DanielMW34 did you change your codepen url to go over http instead of https? and change your APIdomain to like so: var APIdomain = "http://api.openweathermap.org/data/2.5/weather?";
Stephen James
@sjames1958gm
Aug 16 2016 20:46
@DanielMW34 open the devtools console - you will see an error that says the request made by getJSON fails, so there is no response.
Jason Luboff
@JLuboff
Aug 16 2016 20:46
@sjames1958gm Thats the only reason I went with that method was due to accuracy...I didn't like that on mobile it though I was two states over with my IP due to the IP registration
Peter Kenward
@PeterKenward
Aug 16 2016 20:47
@DanielMW34 one of the arguments for the .getJSON method is a 'success function'. That success function is 'where the data goes'... I'm not sure if I expressed that very well...?
Daniel
@DanielMW34
Aug 16 2016 20:48
@JLuboff I made the http change to the API url, that allowed me to see the data in a separate browser tab in JSON format. Upon making the change in codepen to "http:" I am no longer able to get coordinates... hence the catch-22
Jason Luboff
@JLuboff
Aug 16 2016 20:51
@DanielMW34 hmm..odd..its working for me..what browser are you using?
I'm using Firefox
Daniel
@DanielMW34
Aug 16 2016 20:52

@PeterKenward I have read over the getJSON documentation (http://api.jquery.com/jquery.getjson/) however, I don't really understand how--in the success function--do we identify the newly acquired JSON data? Is it a parameter we pass to the success function--if so, do we name it whatever we want?

$.getJSON("http://someAddress", function(newJSONdata) {
$("#someID").html(newJSONdata.firstData);
});

???

@JLuboff the whole thing is working for you? I'm in chrome, will switch to firefox momentarily
Jason Luboff
@JLuboff
Aug 16 2016 20:53
Ah...ya chrome is your issue
You'll see it works in Firefox
Peter Kenward
@PeterKenward
Aug 16 2016 20:54
@DanielMW34 I am working on the same stuff myself right now. I think we may be banging our heads against the same wall... http://codepen.io/Kontact/pen/YWJKXx/?editors=0010
Jason Luboff
@JLuboff
Aug 16 2016 20:54
You'll want to do one of two things, either what @sjames1958gm suggested with using IP-api.com for location which will work regardless of browser but can be very inaccurate or as I mentioned, using https://crossorigin.me as a proxy to send http data over https
Daniel
@DanielMW34
Aug 16 2016 20:55
OMMFG.... Chrome.... Really...
I have lost hours of my life to this issue
and I began to question my sanity
Jason Luboff
@JLuboff
Aug 16 2016 20:55
@DanielMW34 to be fair, your API key wasn't working before too :smile:
Daniel
@DanielMW34
Aug 16 2016 20:55
@JLuboff @PeterKenward @sjames1958gm THANK YOU
CamperBot
@camperbot
Aug 16 2016 20:55
danielmw34 sends brownie points to @jluboff and @peterkenward and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @peterkenward |http://www.freecodecamp.com/peterkenward
:cookie: 288 | @jluboff |http://www.freecodecamp.com/jluboff
:star2: 2662 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Daniel
@DanielMW34
Aug 16 2016 20:55
@JLuboff LOL, that you
thank*
Peter Kenward
@PeterKenward
Aug 16 2016 20:56
lol, I'm glad you 'get it' now. still scratching my head a little...
Daniel
@DanielMW34
Aug 16 2016 20:57
I will go back and read all the input you provided and figure out how to implement it into my solution. GOD BLESS YOU ALL, YOU HAVE SOME DELICIOUS KARMA COMING YOUR WAY @JLuboff @PeterKenward @sjames1958gm
Jason Luboff
@JLuboff
Aug 16 2016 20:58
@DanielMW34 lol thanks Daniel. I wouldn't have been able to help without the help of others here. I'm just spreading the wealth
CamperBot
@camperbot
Aug 16 2016 20:58
jluboff sends brownie points to @danielmw34 :sparkles: :thumbsup: :sparkles:
:cookie: 321 | @danielmw34 |http://www.freecodecamp.com/danielmw34
Daniel
@DanielMW34
Aug 16 2016 20:59
@JLuboff Was it you who identified the problem with my "epic fail" return function? If so, can you help me troubleshoot that because I need to start putting failure return functions in my code?
Jason Luboff
@JLuboff
Aug 16 2016 21:00
I mentioned it, but you'd have to get someone with more knowledge to help you out with that. I don't have any failure functions in my projects :worried:
Daniel
@DanielMW34
Aug 16 2016 21:00
@JLuboff who needs failure functions when your functions never fail.....
Jason Luboff
@JLuboff
Aug 16 2016 21:01
Of course! haha
Stephen James
@sjames1958gm
Aug 16 2016 21:04
@DanielMW34 :+1:
Daniel
@DanielMW34
Aug 16 2016 21:04
TO EVERYBODY----------What browser do you use to see your code?
I formerly used Chrome and now, with Firefox, I am amazed at how different my pens look in FF vs. Chr.
(and, it's nice to see my quote machine working again)
Jason Luboff
@JLuboff
Aug 16 2016 21:05
I main in Firefox, but verify mobile response via Safari on an iPhone 6s as well as using Chrome for checking other screen sizes
Daniel
@DanielMW34
Aug 16 2016 21:06
I have a windows phone and an iPad... my world is ridiculous
Jason Luboff
@JLuboff
Aug 16 2016 21:07
So you can try it in Edge! :shipit:
Daniel
@DanielMW34
Aug 16 2016 21:07
@JLuboff why do you use Firefox (from a front-end dev standpoint)?
Oh, I have Edge too
let me give that a whirl
Jason Luboff
@JLuboff
Aug 16 2016 21:07
No practicular reason other than on Windows its my prefered browser
Daniel
@DanielMW34
Aug 16 2016 21:11
Good answer
Time for some NCAA Football 2014 on the XBox 360
Go Air Force! Beat Fresno State!
Stephen James
@sjames1958gm
Aug 16 2016 21:14
@DanielMW34 :football:
Daniel
@DanielMW34
Aug 16 2016 21:14
@sjames1958gm Yessir!
tyl-er
@tyl-er
Aug 16 2016 21:51
I need some help. I have a navigation bar with some links to other parts of the page. I'm trying to add smooth scrolling, but it's not working. I added some javascript I found on stackoverflow, but it's not working for me.
http://codepen.io/tyl-er/pen/zBybZz?editors=1010
Jason Luboff
@JLuboff
Aug 16 2016 21:52
@tyl-er Make sure the proper libraries are added to your JS settings
tyl-er
@tyl-er
Aug 16 2016 21:53
i added jquery i think, but let me check
@JLuboff Do I need to add a processor too?
Jason Luboff
@JLuboff
Aug 16 2016 21:54
No
tyl-er
@tyl-er
Aug 16 2016 21:56
@JLuboff yeah it's still not working. Does my code look ok?
Jason Luboff
@JLuboff
Aug 16 2016 21:57
I looked, but I'm not familiar enough with the animate function and scrollTop to note if there is an issue or not
tyl-er
@tyl-er
Aug 16 2016 21:57
ok
@JLuboff Thanks I tried some different code and it worked.
CamperBot
@camperbot
Aug 16 2016 22:00
tyl-er sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
Aug 16 2016 22:00
Awesome!
Johnny Rock
@freekngdom
Aug 16 2016 22:26
I'm working on my calculator app and having trouble getting the class of the currently clicked button. I can get the id with clickedButton.id. Why can't I seem to get the class with clickedButton.class?
brascene
@brascene
Aug 16 2016 22:43
@freekngdom try with document.getElementById('btn[class="clickedButton"]);
Moisés Man
@moigithub
Aug 16 2016 22:54
@freekngdom r u using jquery ?
Jason Luboff
@JLuboff
Aug 16 2016 23:16
I'm working on the Twitch app...does anybody by chance know how to access an users logo when they are offline?
encount
@encount
Aug 16 2016 23:18
@freekngdom you can use the att prop - var className = $('.myclass').attr('class');
Johnny Rock
@freekngdom
Aug 16 2016 23:19
Thanks, using className
Stephen James
@sjames1958gm
Aug 16 2016 23:29
@JLuboff you have to go to the channel url
Jason Luboff
@JLuboff
Aug 16 2016 23:31
@sjames1958gm Thanks! That got me the logos, but then is showing accounts offline that are on, I'll have to play around with it! (I haven't looked at the new results)
CamperBot
@camperbot
Aug 16 2016 23:31
jluboff sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2664 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Jason Luboff
@JLuboff
Aug 16 2016 23:35
@sjames1958gm after looking at the results...it seems I'll need to make two seperate $.getJSON calls...one for channels to get the logos...and one for streams to get their status?
Jason Luboff
@JLuboff
Aug 16 2016 23:51
@sjames1958gm don't worry about answering that, I tried it and looks like I'm getting what I need :)
Jerzz
@2cool4school
Aug 16 2016 23:51
hey hows it going ladies and fellas?
sentedelviento
@sentedelviento
Aug 16 2016 23:53
Good, how are you?
Wendy Medeiros
@wendyr21
Aug 16 2016 23:53
good, better if all this coding just morphed into my brain though
sentedelviento
@sentedelviento
Aug 16 2016 23:53
haha
Does anyone have advice on how to make good responsive design? Because I tried setting a vw to my width (absolutely positioned), and then setting the children to be a percentage of the parent. It... isn't working out so well.
Jerzz
@2cool4school
Aug 16 2016 23:55
im straight, just paying my dues on some jquery here
like in-line elements?
Wendy Medeiros
@wendyr21
Aug 16 2016 23:56
bootstrap :)
Jerzz
@2cool4school
Aug 16 2016 23:56
i feel like i would use bootstrap grid
sentedelviento
@sentedelviento
Aug 16 2016 23:56
I haven't learned bootstrap because it annoyed me.
Maybe I should do the thing.
Jerzz
@2cool4school
Aug 16 2016 23:56
its worth it,
sentedelviento
@sentedelviento
Aug 16 2016 23:56
well, I learned a very minimal amount of css, and so learning bootstrap just seemed very confining to me, and also confusing because it was hard to integrate with what I already knew.
Wendy Medeiros
@wendyr21
Aug 16 2016 23:57
@sentedelviento i like it, makes things alot easier once you get the hang of it. or maybe just check on what they have for code and add it to what you need?
sentedelviento
@sentedelviento
Aug 16 2016 23:57
That's where I ran into a lot of problems, because I guess if you just add it where you need instead of using entirely bootstrap, it can cause a lot of problems if you don't know what you're doing. Which is basically my level of css.
Jerzz
@2cool4school
Aug 16 2016 23:58
@sentedelviento I'm in the same boat bro, I'm not here to learn web-design so much, I'll stick to the minimal, thats why i love bootstrap, you can make a sexy nav-bar in a few minutes first try
Wendy Medeiros
@wendyr21
Aug 16 2016 23:58
what @2cool4school just said :) it does make things easy as soon as you start using it more :)
sentedelviento
@sentedelviento
Aug 16 2016 23:58
I'm just frustrated because i've been studying javascript so much I feel like I'm actually decent at it, but if I have to make anything even slightly challenging in css it'll take me hours
I can make a sexy nav bar w/out bootstrap though.
Jerzz
@2cool4school
Aug 16 2016 23:59
@sentedelviento dude it took me a few days to think of how to draw a tic tac toe board
sentedelviento
@sentedelviento
Aug 16 2016 23:59
i spent an entire day trying to replicate the animation from the wikipedia viewer
my entire project looked like shit
but that animation, baby
ahaha, how did you do the tic tac toe board?