These are chat archives for FreeCodeCamp/HelpFrontEnd

24th
Jun 2016
Marco Mazzeo
@Doko85
Jun 24 2016 00:03
oh well I guess I'll call it a night and think about that toggle span tomorrow morning
cya peeps
Uros Tadic
@urketadic
Jun 24 2016 00:03
bye :)
Moisés Man
@moigithub
Jun 24 2016 00:04

@urketadic class names must be surrended on quotes

<div class=container>
<div class= jumbotron>

cols-*-* classes... must be inside /nested in a
"row" class
id="buttoninput"class="col-sm-4
Uros Tadic
@urketadic
Jun 24 2016 00:05
i see and i dont have any rows
but even if fix "" and remove those, its still expanded page
sometimes its fine, for example now in editor but if i go to full page its fuked
its wierd
Uros Tadic
@urketadic
Jun 24 2016 00:11
wtf.. iv been working on this for 2 hours
Moisés Man
@moigithub
Jun 24 2016 00:11
not sure what u mean by expanded... also.. ur cols classes need a row
    <div class="row">  <!--  cols need to be inside a row class   -->
      <div class="input">
        <input type="text" id="inpute" class="col-xs-12 col-sm-6 col-md-8 animated pulse" placeholder="write age">
        <button type="submit" id="buttoninput" class="col-sm-4 btn btn-default btn-danger">Calculate</button>
      </div>

      <div class="output">
        <output id="output" placeholder="output" class="col-xs-12"></output>
      </div>
    </div>
Uros Tadic
@urketadic
Jun 24 2016 00:12
when you go to the page, u can scroll down for a long time
page doesnt end
thats what i mean
Moisés Man
@moigithub
Jun 24 2016 00:12
ok.. i see that now :D
Uros Tadic
@urketadic
Jun 24 2016 00:13
but it dissapears if u are in editor mode and move Html/Css/Javascript box
lol
Moisés Man
@moigithub
Jun 24 2016 00:13
did u check if thats cuz the MISSING "row" class ??
code above...
Uros Tadic
@urketadic
Jun 24 2016 00:14
i just added the row
Aksharif
@abusharif
Jun 24 2016 00:14
need help with "Manipulating Complex Objects"? really confuse what to do here?
Uros Tadic
@urketadic
Jun 24 2016 00:14
but yeah its still
Moisés Man
@moigithub
Jun 24 2016 00:15
also ur output tag need a closing </output>
Uros Tadic
@urketadic
Jun 24 2016 00:15
yea
Moisés Man
@moigithub
Jun 24 2016 00:15
(first time seen an output tag) :)
Uros Tadic
@urketadic
Jun 24 2016 00:16
godamn, still expanding
it would make sence that i didnt close a tag
but its all closed now
Moisés Man
@moigithub
Jun 24 2016 00:16
wonder if thats cuz animate... remove all animate classes to test :)
Uros Tadic
@urketadic
Jun 24 2016 00:16
ok
wtf
yes it seems its because of animate
Moisés Man
@moigithub
Jun 24 2016 00:17
:D
Uros Tadic
@urketadic
Jun 24 2016 00:17
NOPE!!!
if u go to full page its still there
i just give up its ok
its just cancer
Moisés Man
@moigithub
Jun 24 2016 00:18
did u saved ?
cuz i still see those animate classes
Uros Tadic
@urketadic
Jun 24 2016 00:18
yeh
wait
Moisés Man
@moigithub
Jun 24 2016 00:18
animated bounceInUp
animated pulse
Uros Tadic
@urketadic
Jun 24 2016 00:18
ehm..
yeah
yeah..
greg
@wearenotgroot
Jun 24 2016 00:19
@Shawn-Williams check you pm post suggested solution
Uros Tadic
@urketadic
Jun 24 2016 00:19
its ok now.. dont know, was i not using animate correctly :o:
but thank you man @moigithub
CamperBot
@camperbot
Jun 24 2016 00:19
urketadic sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1509 | @moigithub |http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Jun 24 2016 00:20
...dont know :)
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:35
@wearenotgroot Thanks, I'll check that out
CamperBot
@camperbot
Jun 24 2016 00:35
shawn-williams sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1165 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
Toni Shortsleeve
@KoniKodes
Jun 24 2016 00:36
hello.
Regarding Wiki Viewer, has anyone ran into a search term that is not in Wikipedia? I like what I have but it doesn't have some terms (hawaii flower, hawaii royalty...) and just returns a blank. Any suggestions on how to handle that error? Here's my code: http://codepen.io/KoniKodes/full/begdjo/
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:40
@wearenotgroot pardon my gitter newbness, but I haven't figured out how to access private messages
greg
@wearenotgroot
Jun 24 2016 00:41
@Shawn-Williams there shoudl be a person icon to the left <--------- or hover over my icon and choose private chat
Adam Urberg
@aurberg
Jun 24 2016 00:41
@KoniKodes When you get the data back from the API you could check if .length === 0 and show an error
Toni Shortsleeve
@KoniKodes
Jun 24 2016 00:41
@aurberg Thank you so much. That is what I needed :-)
CamperBot
@camperbot
Jun 24 2016 00:41
konikodes sends brownie points to @aurberg :sparkles: :thumbsup: :sparkles:
:cookie: 169 | @aurberg |http://www.freecodecamp.com/aurberg
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:42
@wearenotgroot all I see your icon and the link to my profile.
Ryan
@ispeakcomputer
Jun 24 2016 00:44
hello all .
Would you have any idea how i could overlay a transperent animated gif over another image
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:45
I changed the ip-api call to pass lat and lon to the getWeather function, but now an getting an Unexpected token error. There seems to be an issue with the URI being passed to the weather api. I just can't seem to figure out what I am doing wrong.
$.getJSON("http://ip-api.com/json/?callback=?", function getCoords(data){
     lon = data.lon;
     lat = data.lat;
     //console.log(lat + " " + lon);
     getWeather(lat, lon);
    });

 function getWeather(lat, lon) {
   $.getJSON('http://api.openweathermap.org/data/2.5/weather?lat='+lat+'&lon='+lon+'&APPID=633426622a583ef2abc68bb6b7f8e4e0&callback=?', function(data){
     var condition = (data.weather[0].description).toUpperCase();
     var clouds = data.clouds.all;
     var icon = data.weather[0].icon;
     var temp = data.main.temp;
     var fahr = Math.round((temp*9)/5 - 459.67) + '&deg; F';
     var celc = Math.round(temp - 273.15) + '&deg; C';
greg
@wearenotgroot
Jun 24 2016 00:45
dasdssasad.png
Ryan
@ispeakcomputer
Jun 24 2016 00:45
this is the case site .
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:45
@wearenotgroot I don't have that sidebar for some reason. Let me see if I can remedy that.
Ryan
@ispeakcomputer
Jun 24 2016 00:46
and just now i clicked and the map didnt show up ,wonder why that was
Greg Duncan
@GregatGit
Jun 24 2016 00:48
@Shawn-Williams why do you need getCoords - I think you can leave that out
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:50
@GregatGit I have to have a way to get the coordinates because of the navigator.geolocation security restrictions in Chrome
greg
@wearenotgroot
Jun 24 2016 00:51
@Shawn-Williams he meant you named the anonymous function
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:51
Can I just place this api call in the getWeather function and directly pass that data?
Ah, yeah...it probably should be anonymous...point taken
newb brainfart
greg
@wearenotgroot
Jun 24 2016 00:52
@Shawn-Williams also you can just make getWeather the callback function for ip-api
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:53
hmm
greg
@wearenotgroot
Jun 24 2016 00:54

@Shawn-Williams

$.getJSON("http://ip-api.com/json/?callback=?",getWeather);

 function getWeather(data){
         $.getJSON('http://api.openweathermap.org/data/2.5/weather?lat='+data.lat+'&lon='+data.lon+'&APPID=633426622a583ef2abc68bb6b7f8e4e0&callback=?', function(data){

make sense?

Greg Duncan
@GregatGit
Jun 24 2016 00:54
@Shawn-Williams instead of
lon = data.lon;
lat = data.lat;
// you could just build your api
var myUrl = "http://api.openweathermap.org/data/2.5/weather?lat=" + data.lat + "&lon=" + data.lon  +"&APPID=633426622a583ef2abc68bb6b7f8e4e0"
getWeather(myUrl);
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:54
That would make it more streamlined...why would I want to do that?
lol
greg
@wearenotgroot
Jun 24 2016 00:55
:)
@Shawn-Williams however you need to change the .ready or get rid of it entirely
Shawn Williams
@Shawn-Williams
Jun 24 2016 00:58
do I need to do anything to have this statement execute automaticaly on page load?
$.getJSON("http://ip-api.com/json/?callback=?", getWeather);
Greg Duncan
@GregatGit
Jun 24 2016 00:58
@Shawn-Williams i think you need function(data)
I don't think the ?callback=? is needed
Josh
@joshweaver23
Jun 24 2016 00:59
Hey all, I'm looking for a little help with an angular app. I'm trying to implement a setInterval or $interval type function, but the problem is that I'm using angular 1.0.0... why? because I couldn't (for some reason) get my nested ng-repeats to work in any other version. A fix for either nesting ng-repeats in a later version or work-around for setInterval in 1.0.0 would be amazingly appreciated! CodePen: http://codepen.io/jweaver/pen/GqrKwr?editors=0010
greg
@wearenotgroot
Jun 24 2016 01:00
@Shawn-Williams
$(function (){
//rest of the code
 .....

   //bottom of the code
    $.getJSON("http://ip-api.com/json/?callback=?",getWeather);

})(); //<---------will execute
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:00
That is what I was thinking @wearenotgroot
I was sure the callback=? was something I picked up from the documentation, I'll have to look again
greg
@wearenotgroot
Jun 24 2016 01:01
@Shawn-Williams callback=? on the url to make it jsonp(yeah you can probably leave that out)
Moisés Man
@moigithub
Jun 24 2016 01:01
only IF api dont allow u cross-origin u do jsonp calls
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:02
Ok, my confusion on that. I was thinking JSONP was necessary for all cross-origin calls
jobbanshee
@jobbanshee
Jun 24 2016 01:08
i need this You need an a element that links to http://freecatphotoapp.com.i have this......<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, <a href="https://freecatphotoapp.com">
cat photos</a>shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>what else should i be adding.
Greg Duncan
@GregatGit
Jun 24 2016 01:09
@Shawn-Williams I think you have over engineered this - you have everything you need - you just adding layers that you don't need
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:10
It seems so...lol
I may just refactor from scratch with the advice I have been given
Greg Duncan
@GregatGit
Jun 24 2016 01:11
@Shawn-Williams you start getting lat and lon - keep it annon - only used once - in that function build your new api weather string and call that (keep that annon, too)- and you will have the weather json
@Shawn-Williams you have done it all right - just over done it
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:12
thanks @GregatGit
CamperBot
@camperbot
Jun 24 2016 01:12
shawn-williams sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 619 | @gregatgit |http://www.freecodecamp.com/gregatgit
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:13
It was working well before I started screwing around with it to troubleshoot another functionality...then I kinda jacked it up.
working well /= most effective lol
Greg Duncan
@GregatGit
Jun 24 2016 01:14
@Shawn-Williams keep your changeBG - that's good except don't write this line 3 times
$('body').css("background", "url(" + backgrounds[1] +")");
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:15
k
Greg Duncan
@GregatGit
Jun 24 2016 01:17
the only thing that is changing is the index so the first if should say index = 1;
then at the end
$('body').css("background", "url(" + backgrounds[index] +")");
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:17
@GregatGit I considered creating a variable but couldn't figure out how best to do that
ahh, I see now
not sure why I didn't consider that.
function changeBG() {
     var backgrounds = ['https://dl.dropboxusercontent.com/s/2xor562jpurbyrc/storm-clouds-over-the-road-picjumbo-com.jpg?dl=0','https://dl.dropboxusercontent.com/s/iwf6dmiszg1oy99/sunshine.jpg?dl=0','https://dl.dropboxusercontent.com/s/m1u2cza6mydgr1l/unbelievably-clean-photo-of-wheat-field-with-clouds-picjumbo-com.jpg?dl=0']

     if (clouds <= 20) {
       index=1;
     } else if (clouds >20 && clouds < 70) {
       index=2;
     } else {
       index=0;
     }
    $('body').css("background", "url(" + backgrounds[index] +")");
   };
Greg Duncan
@GregatGit
Jun 24 2016 01:21
@Shawn-Williams yes - don't forget var index; before the if statement
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:22
yeah, that would help. ;)
Greg Duncan
@GregatGit
Jun 24 2016 01:25
I would make it changeBG(num){ and change all the 'clouds' to 'num' - that way you don't have to worry about the scope of clouds and anyone who reads it know exactly what num is (a parameter passed in) they don't have to lookup clouds to under stand it
and no {} needed for one lines
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:29
@GregatGit Thanks
CamperBot
@camperbot
Jun 24 2016 01:29
shawn-williams sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: shawn-williams already gave gregatgit points
Greg Duncan
@GregatGit
Jun 24 2016 01:30
:+1:
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:33
I wasn't actually aware that I didn't need the curly braces for one liners. I did know about the ternary operator though.
Greg Duncan
@GregatGit
Jun 24 2016 01:35
if ($('.temp:contains("F")')) {
        $('.temp').html(celc)
        $('#btn').text('Fahrenheit');
      } else if ($('.temp:contains("C")')){
        $('.temp').html(fahr)
        $('#btn').text('Celcius');
      }
it should finish with else with no condition not else if
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:36
Here is what I did with that
$('#btn').on("click", function(e){
      if ($('#btn').text() == 'Celcius') {
        $('.temp').html(celc)
        $('#btn').text('Fahrenheit');
      } else {
        $('.temp').html(fahr)
        $('#btn').text('Celcius');
      }
That is where I was experimenting because I couldn't seem to get the button to work right. I started throwing jello... /hangingheadinshame
how exactly do I embed my Pen in the chat. It believe it is working properly now.

<p data-height="265" data-theme-id="0" data-slug-hash="JKbEMW" data-default-tab="js,result" data-user="Shawn-Williams" data-embed-version="2" class="codepen">See the Pen <a href="http://codepen.io/Shawn-Williams/pen/JKbEMW/">Weather API Call</a> by Shawn Williams (<a href="http://codepen.io/Shawn-Williams">@Shawn-Williams</a>) on <a href="http://codepen.io">CodePen</a>.</p>

<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

Greg Duncan
@GregatGit
Jun 24 2016 01:38
@Shawn-Williams I already have you pen up - i can just rehresh
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:38
nope...lol
k
Greg Duncan
@GregatGit
Jun 24 2016 01:39
you just paste the url in
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:39
that is too easy...it appears I like to do things the difficult way
Greg Duncan
@GregatGit
Jun 24 2016 01:40
its working fine on my machine except it says "Callaway"
buiphuking
@buiphuking
Jun 24 2016 01:40
hi guys, is there any way to create a div but don't count on scroll bar ?????????
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:40
Hmm, that is definitely not right. It is not showing up properly in the chat either
It says callaway because I forgot to replace that placeholder with the dynamic content.
greg
@wearenotgroot
Jun 24 2016 01:42
just slap some id on the h1 and updated it
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:42
doing that now
Greg Duncan
@GregatGit
Jun 24 2016 01:43
@Shawn-Williams on the top right code pen has a tidy button - it will make your code neater
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:44
I have trouble coding in this little window. I usually keep things nested neatly... :D
greg
@wearenotgroot
Jun 24 2016 01:45
:)
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:45
just noticed
works now
Greg Duncan
@GregatGit
Jun 24 2016 01:46
@Shawn-Williams Bang!
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:46
is it sunny where you are?
greg
@wearenotgroot
Jun 24 2016 01:46
cloudy
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:46
I manually changed values to make sure the images change
so you get the cloudy pic then?
Greg Duncan
@GregatGit
Jun 24 2016 01:47
i'm looking at fiji!
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:47
hopefully it is clear skies there
greg
@wearenotgroot
Jun 24 2016 01:47
picture a beach with few clouds
and chem trails
:smile:
buiphuking
@buiphuking
Jun 24 2016 01:48
i have a div2 inside div1, how to set div2 always at the center vertical and horizontal of div1?????
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:48
hmm, what is the value of data.clouds.all on your end?
@wearenotgroot
greg
@wearenotgroot
Jun 24 2016 01:49
index is 1
weather just update to clear sky
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:50
right, but if you add a console.log(data.clouds.all), what do you get?
or just look at the data object in the inspector I guess?
greg
@wearenotgroot
Jun 24 2016 01:51
it's nill
Greg Duncan
@GregatGit
Jun 24 2016 01:51
@Shawn-Williams to understand you app you have to scroll right down to the bottom then back up to the top - put this above your getWeather $.getJSON("http://ip-api.com/json/", getWeather);
Dan Logajan
@hiltydiggs
Jun 24 2016 01:53
@buiphuking like overflow: hidden? I'm not sure what you mean exactly.
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:53
ok, I had it there originally but changed it under another's advice. Other than enhancing code readability, are there any performance implications?
buiphuking
@buiphuking
Jun 24 2016 01:54
http://codepen.io/buiphuking/pen/aZmWbx
hi guys, how to set .inside-line in same row, i create 3 div
display: inline-block won't work
Greg Duncan
@GregatGit
Jun 24 2016 01:55
@Shawn-Williams no
Dan Logajan
@hiltydiggs
Jun 24 2016 01:57
@buiphuking one thing that I see is you have .button in your css but no button class on your html button element.
Shawn Williams
@Shawn-Williams
Jun 24 2016 01:58
Thanks @moigithub @GregatGit @wearenotgroot I'm off to the next one! I've definitely learned some valuable info from you all
CamperBot
@camperbot
Jun 24 2016 01:58
shawn-williams sends brownie points to @moigithub and @gregatgit and @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1511 | @moigithub |http://www.freecodecamp.com/moigithub
:star2: 1166 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
:warning: shawn-williams already gave gregatgit points
buiphuking
@buiphuking
Jun 24 2016 01:58
@hiltydiggs
div class button
first child of div class wrap
Dan Logajan
@hiltydiggs
Jun 24 2016 01:59
@buiphuking I see it now!
buiphuking
@buiphuking
Jun 24 2016 02:02
@hiltydiggs help me , i'm stuck
bonfire184
@bonfire184
Jun 24 2016 02:02
Why does the personal portfolio webpage include so many topics that were not covered in HTML, CSS, Bootstrap, and jQuery? Clicking a button to scroll to a part of a page, buttons that change color when hovered over?
Dan Logajan
@hiltydiggs
Jun 24 2016 02:02
@buiphuking trying to get it working now.
Mike Short
@mikeshort10
Jun 24 2016 02:03
//////////////////////Part 1////////////////////
  var locale = document.getElementById('locale').value;
  var URL = "http://api.wunderground.com/api/5360ab95c4d3c85f/conditions/q/" + locale + ".json";
  var request = new XMLHttpRequest();
  request.open("GET", URL, false);
  request.send();
  var reply = JSON.parse(request.response);

  //establish var from JSON values
  var town = "The Weather in " + reply.current_observation.display_location.full;
  var weather = reply.current_observation.weather;
  var icon = reply.current_observation.icon_url;
  var temp = reply.current_observation.temp_f;
  var tempString = temp + String.fromCharCode(176) + "F";


///////////////////Part 2//////////////////////

$('#update').click(function() {
    var locale = document.getElementById('locale').value;
  var URL = "http://api.wunderground.com/api/5360ab95c4d3c85f/conditions/q/" + locale + ".json";
  var request = new XMLHttpRequest();
  request.open("GET", URL, false);
  request.send();
  var reply = JSON.parse(request.response);

  //establish var from JSON values
  var town = "The Weather in " + reply.current_observation.display_location.full;
  var weather = reply.current_observation.weather;
  var icon = reply.current_observation.icon_url;
  var temp = reply.current_observation.temp_f;
  var tempString = temp + String.fromCharCode(176) + "F";


////////////////////Part 3///////////////////////////////

  document.getElementById("town").innerHTML = town;
  $('#icon').attr("src", icon);
  document.getElementById("temp").innerHTML = tempString;
  document.getElementById("weather").innerHTML = weather;
  console.log(temp);
});
Hi All, I'm having issues with the above code. Probably a simple explanation, but I'm stuck. I've broken my code up into three parts. Part 1 and 2 are identical, except that Part 2 is inside of a JQuery click function. When both are in the code, Part 3 does not produce what I would like, i.e. a lot of ".innerHTML". When Part 2 is removed and Part 1 remains, it also doesn't work. However, when Part 1 is removed and Part 2 remains, Part 3 works. Can someone explain why? Shouldn't Part 1 act as global variables? Any feedback would be awesome!
Dan Logajan
@hiltydiggs
Jun 24 2016 02:06

@buiphuking

.inside-line * {
  display: inline-block;
}

This works, but the div isn't wide enough so "Strict" wraps to the next line.

buiphuking
@buiphuking
Jun 24 2016 02:07
@hiltydiggs
thanks, i'll handle it
CamperBot
@camperbot
Jun 24 2016 02:07
buiphuking sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 556 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
Jonathan Aguilar
@jonaguiar
Jun 24 2016 02:08
how does one add an image in codepen.io? i am doing the portfolio project is giving me issue.
Dan Logajan
@hiltydiggs
Jun 24 2016 02:09
@bonfire184 it's a good place to jump in. Linking to a spot in page: <div id="about">...</div> and <a href="#about">...</a>
@jonaguiar you have to upload them somewhere else.
Dan Logajan
@hiltydiggs
Jun 24 2016 02:11
@jonaguiar cloudinary was the first result I saw. They have a free plan. You just can't use imgur.
@mikeshort10 your click function isn't closed
@mikeshort10 unless part 3 is part of the click function
Mike Short
@mikeshort10
Jun 24 2016 02:22
Thanks @jonaguiar. I realized the issue was that nothing was initializing Part 1. I created a document ready function and it works now
CamperBot
@camperbot
Jun 24 2016 02:22
:cookie: 121 | @jonaguiar |http://www.freecodecamp.com/jonaguiar
mikeshort10 sends brownie points to @jonaguiar :sparkles: :thumbsup: :sparkles:
buiphuking
@buiphuking
Jun 24 2016 02:36
can i ask something guys, why .strict drop line ??????????/
http://codepen.io/buiphuking/pen/aZmWbx
help me plz
CamperBot
@camperbot
Jun 24 2016 02:41
no wiki entry for: me plz
Josh
@joshweaver23
Jun 24 2016 02:45
Hey all, I'm looking for a little help with an angular app. I'm trying to implement a setInterval or $interval type function, but the problem is that I'm using angular 1.0.0... why? because I couldn't (for some reason) get my nested ng-repeats to work in any other version. A fix for either nesting ng-repeats in a later version or work-around for setInterval in 1.0.0 would be amazingly appreciated! CodePen: http://codepen.io/jweaver/pen/GqrKwr?editors=0010
Susan
@SusanGrattan
Jun 24 2016 03:29
Anyone wanna give feedback on my wiki viewer? http://codepen.io/SusanGrattan/pen/MyrEPQ?editors=1010
I haven't finished styling it yet
Ken Nawrocki
@nawrockp
Jun 24 2016 03:42
@SusanGrattan works fine for me on android
Susan
@SusanGrattan
Jun 24 2016 03:56
thanks @nawrockp
CamperBot
@camperbot
Jun 24 2016 03:56
susangrattan sends brownie points to @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @nawrockp |http://www.freecodecamp.com/nawrockp
Susan
@SusanGrattan
Jun 24 2016 03:57
\
Dario Idrovo
@djidrovo1
Jun 24 2016 03:59
hello
anybody can help me?
please
I want to make my text stay away from the border, but so far I've failed
96street
@96street
Jun 24 2016 04:02
why isn't style.color working here? http://codepen.io/kingdezz/pen/pbRjPY?editors=1010
Lemmy
@imnotlammy
Jun 24 2016 04:10
@djidrovo1 are you referring to the h1?
Dario Idrovo
@djidrovo1
Jun 24 2016 04:10
@imnotlammy lenny, no but I added padding to my boxes
i totally spaced out and forgot about those
is exactly what I was looking for
Lemmy
@imnotlammy
Jun 24 2016 04:11
@djidrovo1 so you fixed it?
Dario Idrovo
@djidrovo1
Jun 24 2016 04:11
@imnotlammy yeah man, thanks anyways.
CamperBot
@camperbot
Jun 24 2016 04:11
djidrovo1 sends brownie points to @imnotlammy :sparkles: :thumbsup: :sparkles:
:cookie: 101 | @imnotlammy |http://www.freecodecamp.com/imnotlammy
Lemmy
@imnotlammy
Jun 24 2016 04:13
@96street I think its better if you create two css classes
@96street sorry
@96street i think its better if you create two css classes
and use jquery to addclass method
Ryan
@ispeakcomputer
Jun 24 2016 04:17
guys , have any idea about the best way of layering a weather radar gif over a google map ?
wish I could get this . Im thinking just stacking because the radar is supposed to be transparent
Ken Nawrocki
@nawrockp
Jun 24 2016 04:21
@needsMoreCoffee as in absolutely positioned and using opacity?
@needsMoreCoffee actually it seems google allows you to do that https://developers.google.com/maps/documentation/javascript/examples/overlay-simple
Luis Felipe López G.
@luishendrix92
Jun 24 2016 04:25
@needsMoreCoffee You can set the container of the map to have position: relative, then, after the map (below it) have your radar and you must be sure the gif is transparent, then set the radar's position: absolute and you can dinamically set the "top" and "left" position in pixels or percentages dinamically with JS if your goal is to make it non-staticly positioned.
Also don't forget to add some z-index if your div is still not showing on top of the map
Paolo
@mav1283
Jun 24 2016 04:51

Guys need help on the twitch tv

i tried the api url without the freecodecamp channel just this: "https://api.twitch.tv/kraken/streams/" and i loop around it and can only display the online channels how come the offline channel doesn't show up? my condition statement inside the forloop is:var channel;var status = "";for(var i=0; i<data.streams.lengh;i++){channel = data.streams[i].channel;if(channel === null){status = "Offline";}else{status = "Online";}//appended ul list here}only online channels append the ul list, but no offline channels.

i tried both $.ajax and $.getJSON the same output

we7d
@we7d
Jun 24 2016 04:54
Hi guys i'm stuck at the wikipediaViewer , can anyone tell me what's wrong with my Json query http://codepen.io/we7d/pen/dXNGpe
Ken Nawrocki
@nawrockp
Jun 24 2016 05:05
@we7d have you tried chrime dev tools?
The console in codepen does not show errors
Ryan
@ispeakcomputer
Jun 24 2016 05:23
@nawrockp sorry i was coding. I will check that out. thanks.
CamperBot
@camperbot
Jun 24 2016 05:23
needsmorecoffee sends brownie points to @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 321 | @nawrockp |http://www.freecodecamp.com/nawrockp
we7d
@we7d
Jun 24 2016 05:25
i see an "Access-Control-Allow-Origin" error
kirbyedy
@kirbyedy
Jun 24 2016 05:51
@we7d add this to your getjson line: callback=?
we7d
@we7d
Jun 24 2016 05:52
changed dataType to jsonp in the $.ajax and it worked
thanks @kirbyedy and @nawrockp
CamperBot
@camperbot
Jun 24 2016 05:54
we7d sends brownie points to @kirbyedy and @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 322 | @nawrockp |http://www.freecodecamp.com/nawrockp
:star2: 1149 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Wilfred
@wilfredtommy
Jun 24 2016 07:33
how do I make the font slightly tilted in html, css or jquery?
kirbyedy
@kirbyedy
Jun 24 2016 07:42
@wilfredtommy <i>
Greg Duncan
@GregatGit
Jun 24 2016 07:47
@wilfredtommy you can look through code pen - they have loads of really cool pens
Wilfred
@wilfredtommy
Jun 24 2016 08:05
@kirbyedy Thanks
CamperBot
@camperbot
Jun 24 2016 08:05
wilfredtommy sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1150 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Monyi ALex
@janitech
Jun 24 2016 08:09
Hello Code Fraternity
fluffystub
@RakshithNM
Jun 24 2016 09:06
var canvas = document.getElementById('paint');
var ctx = canvas.getContext("2d");

canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

var putPoint = function(e) {
    ctx.beginPath();
    ctx.arc(e.offSetX, e.offSetY, 10, 0, Math.PI * 2);
    ctx.fill();
}

canvas.addEventListener( 'mousedown' , putPoint );
body { 
    margin : 0;
}
<body>
    <canvas id="paint">May be you should try another browser.</canvas>
</body>
working on a simple paint app using HTML5 canvas
unable figure out my mistake
please help
Le Anh Duy (Andrew)
@leanhduy1998
Jun 24 2016 09:13
Hi guys, I don't really know how to do the No Repeats Please problem. How do you generate all Permutations using heap? I looked at the heap algorithm but still didn't understand it. I'm struggling with this problem.
Wilfred
@wilfredtommy
Jun 24 2016 10:15
How do I put text within a border?
I have an image and I've made a white border on the bottom of it. How do I input text in there?
Arth95
@Arth95
Jun 24 2016 10:19
Hi, I have an issue with animations.
I want to make transition between "two views". My problem is, when view changes div fading out jumps down making space for div fading in
can I fix it somehow?
Jack Lyons
@JackEdwardLyons
Jun 24 2016 10:50
hey guys, im making a simple little game as a side project, was wondering if anyone wanted to help me out?
just with my JS logic
nakarinh14
@Holydark30
Jun 24 2016 11:15
Hey guys, i got some prob with the mediawiki api and fail to return data, I am not sure what the problem is.
Here is the link to my codepen: http://codepen.io/Holydark30/pen/EyZPOE
function search(){
  var keyword = form.value;
  var c;
  $.getJSON('https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srsearch=' + keyword, function(data){
    c = data;
  })
    .fail(function(){
      document.writeln("FAIL");
    })
}
Tbuglc
@tbuglc
Jun 24 2016 11:22
@Holydark30 you can access data on wiki api like this
c = data.query.pages
kirbyedy
@kirbyedy
Jun 24 2016 11:24
@Holydark30 callback=?
Tbuglc
@tbuglc
Jun 24 2016 11:27
@Holydark30 Have a look at this api and see how data are formatted
https://en.wikipedia.org/w/api.php?action=query&generator=search&gsrlimit=10&format=jsonfm&callback=JSON_CALLBACK&prop=extracts&prop=extracts&exintro&exsentences=3&exlimit=max&gsrsearch=api&callback=?%27
nakarinh14
@Holydark30
Jun 24 2016 11:27
@tbuglc ok thx!
CamperBot
@camperbot
Jun 24 2016 11:27
holydark30 sends brownie points to @tbuglc :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @tbuglc |http://www.freecodecamp.com/tbuglc
nakarinh14
@Holydark30
Jun 24 2016 11:43
@kirbyedy I try adding callback=? but it returns [object Object] instead of the data
kirbyedy
@kirbyedy
Jun 24 2016 11:44
yes its an array of objects
nakarinh14
@Holydark30
Jun 24 2016 11:44
@kirbyedy i mean the exact result is [object Object], no data object and stuff
Maybe you can try to check out my pen
kirbyedy
@kirbyedy
Jun 24 2016 11:50
Screen Shot 2016-06-24 at 14.49.23.png
nakarinh14
@Holydark30
Jun 24 2016 11:53
@kirbyedy Ahh, my bad… I forgot to stringify
@kirbyedy Thx for the help!
CamperBot
@camperbot
Jun 24 2016 11:53
holydark30 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1152 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Alessandro
@alemaggiolini
Jun 24 2016 12:25
Hi guys! I've got a problem and need your help. Using Google APIs, I get information about an Artwork. In my server I've uploaded e-books and when I type an artwork, I want JS to look for the period-related e-books and suggest them to me. Is that possible?
Impossibeard
@Impossibeard
Jun 24 2016 12:28
Navigating the DOM with JS is crazy hard -_-;
What’s the difference between moving up the dom and down the dom?
Moving up means toward <html>?
kirbyedy
@kirbyedy
Jun 24 2016 12:32
I think so, not sure
Alessandro
@alemaggiolini
Jun 24 2016 12:38
any way you can help me?
Luke
@lukenetti3
Jun 24 2016 12:45
Hey guys, is there any cloud animation for day and night time that I can use for my local weather app?
Ive searched the internet and having trouble finding something...Is there anything that I can add to codepen like is possible with the weather icons.
Stephen
@stephepush
Jun 24 2016 13:18
hi everyone, whats the best way to hard code quotes for the quote generator? Should I put the quotes in an object or in an array?
Subramanya Chakravarthy
@chakrihacker
Jun 24 2016 13:27
guys please suggest me where to learn css
JD Tadlock
@jdtdesigns
Jun 24 2016 13:33
@alemaggiolini Are you using google to host the e-books or your server?
@chakrihacker Teamtreehouse, youtube, codecademy and many others
Subramanya Chakravarthy
@chakrihacker
Jun 24 2016 13:35
thanks
JD Tadlock
@jdtdesigns
Jun 24 2016 13:35
@stephepush The challenge is to use an api. Search on google for free quote apis
Alessandro
@alemaggiolini
Jun 24 2016 13:37
@jdtdesigns We are using our server
@jdtdesigns But the APIs are from Google
Impossibeard
@Impossibeard
Jun 24 2016 13:38
I have an assignment asking me to create a function that keeps traversing the DOM upward until a parent with a specified class name is found. Trying to wrap my head around it, but any help would really be appreciated.
JD Tadlock
@jdtdesigns
Jun 24 2016 13:38
@alemaggiolini If you're using your server to host the e-books, why do you need google for anything?
Alessandro
@alemaggiolini
Jun 24 2016 13:39
For the APIs to look for details about ArtWorks. Then I want the code for a match between the user's input and the actual e-book's tag
JD Tadlock
@jdtdesigns
Jun 24 2016 13:41
@alemaggiolini are you using php?
Alessandro
@alemaggiolini
Jun 24 2016 13:41
Yes but i'm open to any languages
JD Tadlock
@jdtdesigns
Jun 24 2016 13:45
@alemaggiolini are you using a php framework?
Alessandro
@alemaggiolini
Jun 24 2016 13:50
no @jdtdesigns
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 14:19
hi guys i'm doing Weather app can anyone help me with my code, im trying to convert C to F and F to C. I succeed in convert C to F on click but coundnt on F to C. Here is my pen http://codepen.io/huynguyenthuong/pen/EyNXBm?editors=1010
lcassettai
@lcassettai
Jun 24 2016 14:28
@NguyenThuongHuy i made it like this, i think there must be a better way but maybe can help you
//this is the button //
<a class="changeaf" data-toggle='0'>°C</a>

//this is the js that change the val and text//
  $('.changeaf').on('click',function(){
    if(this.getAttribute('data-toggle') == 0){
       temperatura = (((temperatura * 9)/5) + 32).toFixed(1);
       $('.temperatura').text(temperatura);
       $('.changeaf').text('°F');
      this.setAttribute('data-toggle',1);
    }else{
       temperatura = (((temperatura -32)*5) /9).toFixed(1);
       $('.temperatura').text(temperatura);
       $('.changeaf').text('°C');
      this.setAttribute('data-toggle',0);
    }         
  });
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 14:31
@lcassettai Thanks
CamperBot
@camperbot
Jun 24 2016 14:31
:cookie: 339 | @lcassettai |http://www.freecodecamp.com/lcassettai
nguyenthuonghuy sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
Sorin Ruse
@sorinr
Jun 24 2016 14:37
@NguyenThuongHuy you are getting data from the weather api in metric so you just need to convert it to F as you do with your function. so when you want it back in C just replace what you need with the initial values from returned json
Marco Mazzeo
@Doko85
Jun 24 2016 14:48
man, I don't get why my weather app stopped working out of the blue
I'm on my laptop now and it doesn't even retrieve data from the ip-api url
does it work for you guys? http://codepen.io/doko/details/gMPWjq/
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 14:50
@sorinr yeah that is what im trying to do , i succeeded in convert C to F but fail try to make it onclick convert back to C base on api data
Sorin Ruse
@sorinr
Jun 24 2016 14:53
@NguyenThuongHuy when you click on your button with the id="convert" check to see if its val() is F then you apply the old values in metric both to your <p id="temp"> and change the text to button back to C
lcassettai
@lcassettai
Jun 24 2016 14:53

@Doko85 yoou declare the variable apikey after you use, just put

 var apikey = "69ae4e5cd9c17ed671c3b26166ebe131"; // Please use your own ID!

before

  $.getJSON(geo_api, function(json){
      var lat = json.lat;
      var lon = json.lon;
        var weather_api = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=" + apikey;
Marco Mazzeo
@Doko85
Jun 24 2016 14:54
DAMN
the code messed up
thanks @lcassettai
lcassettai
@lcassettai
Jun 24 2016 14:55
@Doko85 hah no problem bro! nice app i really like your styles
Marco Mazzeo
@Doko85
Jun 24 2016 14:55
thanks
I wish I could make the final adjustment and move on
Diego Mayer
@Chrono79
Jun 24 2016 14:55

Hi I have a quick question, I have to take the data from a responsive template where there are 2 inputs with the same id (I know, bad idea) here is the code:

<td>
                              <div class="input-group bootstrap-touchspin">
                                <span class="input-group-btn"><button class="btn btn-link bootstrap-touchspin-down" type="button">-</button><button class="btn btn-default bootstrap-touchspin-down" type="button">-</button></span>
                                <span class="input-group-addon bootstrap-touchspin-prefix" style="display: none;"></span><input id="n1" class="addit form-control" type="text" name="n1" value="0" style="display: block;"><span class="input-group-addon bootstrap-touchspin-postfix" style="display: none;"></span>
                                <span class="input-group-btn"><button class="btn btn-default bootstrap-touchspin-up" type="button">+</button><button class="btn btn-link bootstrap-touchspin-up" type="button">+</button></span>
                              </div>
                              <div class="qtyresp">
                              <select name="n1" class="c-select-md">
                              <option>0</option>
                              <option>1</option>
                              <option>2</option>
                              <option>3</option>
                              <option>4</option>
                              <option>5</option>
                              <option>6</option>
                              <option>7</option>
                              <option>8</option>
                              <option>9</option>
                              <option>10</option>
                              </select>
                              </div>
                              </td>

They're not shown at the same time, but it's clear that when I submit the form the value that's sent is the one of the select, is there any way to do it right and keep the responsive functionality? Thanks in advance

Sorin Ruse
@sorinr
Jun 24 2016 15:00
@NguyenThuongHuy add a global var temp; to the begging of your js script tag. then when u make the first call, store the json returned temp into this global var to be reused to change back from F to C. hope u understood what i wanted to say
APSP
@APSP
Jun 24 2016 15:02
hey everyone. I am doing the tribute page front end dev project. I am stuck at the part where the text needs to be center aligned with margins on both sides. Can anyone help?
JD Tadlock
@jdtdesigns
Jun 24 2016 15:03
@Doko85 Your api key variable needs to be above the api url variable
Marco Mazzeo
@Doko85
Jun 24 2016 15:06
yeah I found that somehow my first part of the code doubled itself and I removed the second copy, I didn't notice that the key was declared after the api url
anyway, I want to use the weather icons instead of the weatherapi ones, I will make a switch to check if "description" is === to each of the text the api passes and then load the wi icon related, will it work? @jdtdesigns
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:11
@sorinr yes i understand, i did try it but it didnt work for me.
Sorin Ruse
@sorinr
Jun 24 2016 15:11
@APSP if u r using bootstrap take a look here: http://getbootstrap.com/css/#type-alignment
Matt Stevens
@complementstudio
Jun 24 2016 15:12
@APSP Can you try applying margin: 0 auto; to the element with text-align: center
Sorin Ruse
@sorinr
Jun 24 2016 15:13
@NguyenThuongHuy where is your global var for storing initial C temp?
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:14
just above function update
JD Tadlock
@jdtdesigns
Jun 24 2016 15:14
@Doko85 I used weather icons for mine. All you need to do it reference the id of the condition and concat that onto the weathericons class.
Mine is the one you got that switch from ;)
Marco Mazzeo
@Doko85
Jun 24 2016 15:15
still I can't make it work tho
maybe you can help me
it doesn't move
APSP
@APSP
Jun 24 2016 15:17
@sorinr ok thanks. i tried it and i got the text center aligned but this isnt what i wanted. I just realized i that i just need the margins
CamperBot
@camperbot
Jun 24 2016 15:17
:cookie: 383 | @sorinr |http://www.freecodecamp.com/sorinr
apsp sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
JD Tadlock
@jdtdesigns
Jun 24 2016 15:17
@Doko85 did you add the toggle class and setup the click toggle in the js?
Marco Mazzeo
@Doko85
Jun 24 2016 15:17
yeah
APSP
@APSP
Jun 24 2016 15:20
@complementstudio ummm i am a beginner. so i didn't get what you said. You mean i should create a margin class and then use it?
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:20
@sorinr the problem is i try to make click event 1st click will change C to F, then 2nd click change back to C and .on only works when only have function C to F.
Matt Stevens
@complementstudio
Jun 24 2016 15:20
@APSP Can you send me your codepen ?
Matt Stevens
@complementstudio
Jun 24 2016 15:21
@APSP So which part are you struggling with
APSP
@APSP
Jun 24 2016 15:22
@complementstudio the text part
Sorin Ruse
@sorinr
Jun 24 2016 15:22
@NguyenThuongHuy get rid of that second click on your on event. i said when you trigger the click test to see if your $("#temp").val() returns C or F and make appropiate changes. just use an if statement
APSP
@APSP
Jun 24 2016 15:23
@complementstudio https://codepen.io/FreeCodeCamp/full/NNvBQW/ the actual freecodecamp sample i need to replicate
Matt Stevens
@complementstudio
Jun 24 2016 15:23
@APSP I just sent you a private message, let's go there for help
Marco Mazzeo
@Doko85
Jun 24 2016 15:27
@jdtdesigns don't know why but it's not working on my pen but your version is working fine
#unit-toggle {
  position: absolute;
  display: inline-block;
  left: 3px;
  top: 4px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 2px 0 0 #B27348, -2px 0 0 #B27348, 2px 2px 0 #B27348, 0 -2px 0 #B27348, 2px 2px #B27348, -1px -1px 0 #B27348, 2px -2px 0 #B27348, -1px 1px 0 #B27348;
} 

#unit-toggle.toggle {
  left: 34px;
}
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:33
@sorinr can you tell me where should i put the if ? at this state http://codepen.io/huynguyenthuong/pen/EyNXBm?editors=1010
Sorin Ruse
@sorinr
Jun 24 2016 15:35
@NguyenThuongHuy after here: $("#convert").on({
  click: function(){ if(.....)
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 15:36
why does the geolocation not work anymore?
greg
@wearenotgroot
Jun 24 2016 15:41
@hristijankiko what browser are you using?
Bunny Vishal
@bunnyvishal6
Jun 24 2016 15:44
Hello everyone , please take a look at my recent project tic tac toe at https://mtictactoe.bunnyvishal.com
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:45
@sorinr whta should i put in condition of if ? $("#convert").val() == "C" ?
greg
@wearenotgroot
Jun 24 2016 15:45
@hristijankiko anyways, geolocation on chrome require https connection(required for getCurrentPostion and watchPosition )
Huy Nguyen Thuong
@NguyenThuongHuy
Jun 24 2016 15:47
@sorinr nevermind i got it Thank you so much i just change .val to .text
CamperBot
@camperbot
Jun 24 2016 15:47
nguyenthuonghuy sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 384 | @sorinr |http://www.freecodecamp.com/sorinr
MikeBeers
@MikeBeers
Jun 24 2016 16:03
Hi
In settimeout I want to use a function to adjust the delay. Is that possible?
hallowcard13
@hallowcard13
Jun 24 2016 16:08
@MikeBeers i think you can do like these settimeout(3000)
MikeBeers
@MikeBeers
Jun 24 2016 16:10
?
Trying setTimeout ( function () {}, 1000 - result of function )
Marco Mazzeo
@Doko85
Jun 24 2016 16:15
the icons work... eureka! hahah
Marco Mazzeo
@Doko85
Jun 24 2016 16:23
@jdtdesigns thanks for your help! I didn't notice you edited the js part too, thats why it wasn't working on my codepen tab ;)
CamperBot
@camperbot
Jun 24 2016 16:23
doko85 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 561 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Julie
@jurijuri
Jun 24 2016 16:25
@wearenotgroot finished my wiki app - thanks for your help! I think I might even sort of understand the API now ;)
CamperBot
@camperbot
Jun 24 2016 16:25
jurijuri sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1167 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
Marco Mazzeo
@Doko85
Jun 24 2016 16:26
guys any of you live in a place where the weather is not "clear sky" ?
like rain, snow, wind, whatever?
I wanna know if the switch is working for the other conditions
greg
@wearenotgroot
Jun 24 2016 16:27
@jurijuri good job :+1:
Sorin Ruse
@sorinr
Jun 24 2016 16:31
@Doko85 can you pm your codepen? to test your weather app
Marco Mazzeo
@Doko85
Jun 24 2016 16:32
one sec I'm implementing more conditions cause atm it's only windy, clear sky and rainy
Alejandro Ñáñez Ortiz
@alejandronanez
Jun 24 2016 16:32
Guys, question here. Is it necessary to use codepen for the projects? Can I use github pages and just link the repo? I’d rather work locally than in codepen tbh.
Marco Mazzeo
@Doko85
Jun 24 2016 16:34
just work locally and then paste the code on codepen
Sorin Ruse
@sorinr
Jun 24 2016 16:34
@alejandronanez i also prefer to use locally but when i'm finished i copy paste all of my code to codepen. this way when i want to share it and ask for help, everybody can see my code and be able to help
MikeBeers
@MikeBeers
Jun 24 2016 16:38
Looking for help on a setTimeout issue
If I post code can I get someone to look at it
Sorin Ruse
@sorinr
Jun 24 2016 16:40
@MikeBeers whats the problem you have with setTimeout? the function is quite about what it does: Executes a function, after waiting a specified number of milliseconds.
MikeBeers
@MikeBeers
Jun 24 2016 16:41
Trying to see if I can use a function to adjust the delay
Instead of 1000 milliseconds use a function to determine the number
Sorin Ruse
@sorinr
Jun 24 2016 16:44
@MikeBeers window.setTimeout(function, milliseconds); and I don't see why you can't it write like window.setTimeout(function, getMyDelay());
MikeBeers
@MikeBeers
Jun 24 2016 16:44
Trying to change milliseconds based on a certain situation.
iterate: function() {  // flashes each color from cpArray
        for (var i = 0; i < this.cpArr.length; i++) {
            setTimeout(function(x) {
                return function() {
                    if (game.cpArr[x] === "green") {
                        display.flash('green');
                    }
                    if (game.cpArr[x] === "red") {
                        display.flash('red');
                    }
                    if (game.cpArr[x] === "yellow") {
                        display.flash('yellow');
                    }
                    if (game.cpArr[x] === "blue") {
                        display.flash('blue');
                    }
                }
            }(i), 1000 * i - game.speed);
        }
    },
    speed: function() {
        if (round < 8) {
            return 100;
        }
        if (round < 13) {
            return 300;
        } else {
            return 400;
        }
    },
  • game.speed not working. If I use a real number I get desired results
  • game
1000 * I - game.speed not working
Sanne
@sannek
Jun 24 2016 16:48
You probably just need to call game.speed() because it's a function
with the parentheses
MikeBeers
@MikeBeers
Jun 24 2016 16:48
Uh. Good catch.
Will try
amir
@aizen3
Jun 24 2016 16:49
guys how can i nest the text input element within a form element.?
MikeBeers
@MikeBeers
Jun 24 2016 16:54
@sannek thanks. That worked
CamperBot
@camperbot
Jun 24 2016 16:54
mikebeers sends brownie points to @sannek :sparkles: :thumbsup: :sparkles:
:cookie: 432 | @sannek |http://www.freecodecamp.com/sannek
Marco Mazzeo
@Doko85
Jun 24 2016 16:54
does the icon switch for you guys or is it always "clear sky" =
?
Sanne
@sannek
Jun 24 2016 16:54
@Doko85 It says few clouds for me!
Marco Mazzeo
@Doko85
Jun 24 2016 16:55
and the icon is what?
Sanne
@sannek
Jun 24 2016 16:55
A sun with a cloud in front of it
Marco Mazzeo
@Doko85
Jun 24 2016 16:55
cool it works :D
Sanne
@sannek
Jun 24 2016 16:55
Nice!
Marco Mazzeo
@Doko85
Jun 24 2016 16:56
k time to stop now, I'll keep on working on this later... cya guys, ttyl
Sorin Ruse
@sorinr
Jun 24 2016 17:00
@Doko85 here how i treated wi icons:https://codepen.io/sorinr/pen/xOGdYz and tried to mach them looking here: http://openweathermap.org/weather-conditions
Oxide Debbarma
@oxide94Git
Jun 24 2016 17:00
hey buddies where can i get twitter bird glyph?
bsandusky
@bsandusky
Jun 24 2016 17:01
@sorinr Really nice!
Sorin Ruse
@sorinr
Jun 24 2016 17:04
@bsandusky thanks for the feedback
CamperBot
@camperbot
Jun 24 2016 17:04
sorinr sends brownie points to @bsandusky :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @bsandusky |http://www.freecodecamp.com/bsandusky
Neha
@nehasinha1805
Jun 24 2016 17:11
what does "target" class do?
Hey everyone! Working on the random quote machine. I just need to figure out how to tweet the quote. Can someone help me with that?
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:18
@abibliophile here you go https://dev.twitter.com/web/tweet-button
@abibliophile the how to add a tweet button section
Ariel
@abibliophile
Jun 24 2016 17:21
thanks @hristijankiko i'm just having trouble linking the actual quote bc it's random
CamperBot
@camperbot
Jun 24 2016 17:21
abibliophile sends brownie points to @hristijankiko :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @hristijankiko |http://www.freecodecamp.com/hristijankiko
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:21
@abibliophile you need to create the link as a string using javascript
@abibliophile then add it to the element
Ariel
@abibliophile
Jun 24 2016 17:24
thanks!!
Ray Liu
@mania7539
Jun 24 2016 17:32
Hello campers, I just finish coding the calculator project!! Feel like very excited to share with you guys!! If you are keen, plz let me know your suggestions and opinions about it , link here ;) http://codepen.io/mania7539/full/WxRwGj
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:34
@mania7539 Looks great
flindip
@flindip
Jun 24 2016 17:35
Working on the "Local Weather app" trying to get my default switch option to post a background image. Is my syntax correct?
http://codepen.io/flindip/pen/xOgbva
pretty sure the api is working. So, it should be displaying the default
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:38
@flindip It is displaying the default
flindip
@flindip
Jun 24 2016 17:39
@hristijankiko its just a white blank screen for me. Do I have to fill it in or something
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:40
@flindip This is what i see http://prntscr.com/bkke15 However in the chat version here it doesnt work
flindip
@flindip
Jun 24 2016 17:41
@hristijankiko odd, yeah, thats the pic....
@hristijankiko are you using chrome?
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:42
@flindip Yeah
flindip
@flindip
Jun 24 2016 17:43
@hristijankiko so, its only displaying in chrome.
I was under the impression that IP API can be used in every browser. Only Geolocation has conflict with Chrome. Thats why I didn't use it
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:45
@flindip The IP API is not browser dependent i think
flindip
@flindip
Jun 24 2016 17:46
@hristijankiko Yeah, thats what I thought. But, why is it only displaying in chrome?
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:46
@flindip Open the console and check for errors
flindip
@flindip
Jun 24 2016 17:48

@hristijankiko I think I have the issue:
[Warning] [blocked] The page at https://codepen.io/flindip/pen/xOgbva was not allowed to display insecure content from http://ip-api.com/json. (everypage-0462c18cbe9964520f651941b488b88b.js, line 3)

So, there is a conflict with codepen. Any idea how to get to respond with Codepen?

Ray Liu
@mania7539
Jun 24 2016 17:51
@hristijankiko thank you dude, do hope you like it :)
CamperBot
@camperbot
Jun 24 2016 17:51
mania7539 sends brownie points to @hristijankiko :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @hristijankiko |http://www.freecodecamp.com/hristijankiko
JD Tadlock
@jdtdesigns
Jun 24 2016 17:52
@flindip Same issue from a week ago lol. You CANNOT load codepen on HTTPS and use an api with HTTP.
flindip
@flindip
Jun 24 2016 17:53
@jdtdesigns I took out all the HTTPS. Everything is using HTTP. So Codepen can't use HTTP?
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 17:54
@flindip Is it working now?
JD Tadlock
@jdtdesigns
Jun 24 2016 17:54
@flindip you just linked to your codepen with https://codepen.io/yoururl
won't work
flindip
@flindip
Jun 24 2016 17:54
@jdtdesigns Then that was a mistype on my part.
JD Tadlock
@jdtdesigns
Jun 24 2016 17:54
that's the only problem you have and will continue everytime you load https lol
Sorin Ruse
@sorinr
Jun 24 2016 17:56
@flindip you have to do it all over http and you have to find some other ways or just go with everything over https as @jdtdesigns says
lpcavenaghi
@lpcavenaghi
Jun 24 2016 17:56

Hello everyone! I'm having some trouble trying to use this random quote API:

http://forismatic.com/en/api/

I'm using this javascript code to retrieve it:

function getQuote() {
 $.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en", function(json) {
    console.log("json.quoteText: " + json.quoteText);
    currentQuote = json.quoteText;
    currentAuthor = json.quoteAuthor;
  });
}

But it doesn't work and I get this message on the Chrome's Console:

XMLHttpRequest cannot load http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.

flindip
@flindip
Jun 24 2016 17:56
@jdtdesigns It works. Thanks... @sorinr
CamperBot
@camperbot
Jun 24 2016 17:56
flindip sends brownie points to @jdtdesigns and @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 562 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
:cookie: 386 | @sorinr |http://www.freecodecamp.com/sorinr
I'm not sure why its not displaying properly in the chat. But it works fine in the codepen
Sorin Ruse
@sorinr
Jun 24 2016 17:59
@lpcavenaghi try to change the call to https://api.forismatic
JD Tadlock
@jdtdesigns
Jun 24 2016 17:59
@flindip because the chat doesn't allow certain content
load it from a different tab
flindip
@flindip
Jun 24 2016 17:59
@jdtdesigns I see. Now I can plug in the assets and finish the project up
JD Tadlock
@jdtdesigns
Jun 24 2016 18:01
@lpcavenaghi
function getQuote() {
 $.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?", function(json) {
    console.log("json.quoteText: " + json.quoteText);
    currentQuote = json.quoteText;
    currentAuthor = json.quoteAuthor;
  });
}
have to declare the correct format and use the jsonp callback param
Sorin Ruse
@sorinr
Jun 24 2016 18:03
@lpcavenaghi a jsonp callback will also help you as @jdtdesigns said
JD Tadlock
@jdtdesigns
Jun 24 2016 18:04
a jsonp callback is required so not really avoidable lol
Sorin Ruse
@sorinr
Jun 24 2016 18:04
@jdtdesigns i hate this cors solving way
JD Tadlock
@jdtdesigns
Jun 24 2016 18:05
helps to learn how to deal with data in different ways
lpcavenaghi
@lpcavenaghi
Jun 24 2016 18:06
@jdtdesigns It worked, thanks!!
CamperBot
@camperbot
Jun 24 2016 18:06
lpcavenaghi sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 563 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Jun 24 2016 18:06
;)
lpcavenaghi
@lpcavenaghi
Jun 24 2016 18:07
@jdtdesigns Why was it necessary to add this jsonp?
JD Tadlock
@jdtdesigns
Jun 24 2016 18:07
when you're returning jsonp, you must use a callback method to display the data
same as json, but for jsonp you must declare what function you're calling
so '?' just means you're calling an anonymous function
Husam
@7usam
Jun 24 2016 18:08
Hello guys !
I need help :(
JD Tadlock
@jdtdesigns
Jun 24 2016 18:08
@lpcavenaghi
Husam
@7usam
Jun 24 2016 18:09

<p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a>.</p>

Replace the value of your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link.

how can I do that ?
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 18:09
@7usam href="#" like this
JD Tadlock
@jdtdesigns
Jun 24 2016 18:09
umm
lpcavenaghi
@lpcavenaghi
Jun 24 2016 18:09
I see...thank you @jdtdesigns
Husam
@7usam
Jun 24 2016 18:09
thanks a lot @hristijankiko
CamperBot
@camperbot
Jun 24 2016 18:09
7usam sends brownie points to @hristijankiko :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @hristijankiko |http://www.freecodecamp.com/hristijankiko
Husam
@7usam
Jun 24 2016 18:11
@hristijankiko what if i just do this href="" wouldn't that be the same as href="#" ?
JD Tadlock
@jdtdesigns
Jun 24 2016 18:12
@7usam That's invalid
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 18:12
@7usam Yeah you should always use # for empty links
Husam
@7usam
Jun 24 2016 18:12
so the hash has a function of turning href link into a dead link thanks !
sorry I'm a newbie @hristijankiko :$
Hristijan Gjorgjievski
@hristijankiko
Jun 24 2016 18:14
@7usam Dont worry :D
miksDev
@miksDev
Jun 24 2016 18:22
<h2 class="red-text">CatPhotoApp</h2>
srishti-learner
@srishti-learner
Jun 24 2016 18:23
hey everyone,i am working on the weather app but i am getting an connection refused error! i am trying out the js part first and got stuck! here it goes-
Lignux
@Gadzev
Jun 24 2016 18:24
Why when i try to rotate the element here it moves out of position instead of staying in the center? http://codepen.io/lignux/pen/begWwB
lpcavenaghi
@lpcavenaghi
Jun 24 2016 18:28
@jdtdesigns Got it! Thank you again :smile:
http://codepen.io/lpcavenaghi/full/yJggaZ/
CamperBot
@camperbot
Jun 24 2016 18:28
lpcavenaghi sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: lpcavenaghi already gave jdtdesigns points
JD Tadlock
@jdtdesigns
Jun 24 2016 18:31
@lpcavenaghi Now the sky is the limit ;)
Trevor Hunka
@Grizvok
Jun 24 2016 18:49
Looking for help regarding my API call on the twitchAPI project when a user is offline...really want to be able to display logos even for offline users
the documentation the freecodecamp posts is really only for the streams api endpoint
ive found out using the users endpoint that even if offline it allows you to find the logo
Moisés Man
@moigithub
Jun 24 2016 18:52
@Grizvok there r 2 api endpoints.. streams and channels
Trevor Hunka
@Grizvok
Jun 24 2016 18:52
users is one as well.
Robert Kregloh
@gxrobb
Jun 24 2016 18:53
Im looking for some help with the pomodoro clock project, I dont grasp how to start and stop my timer, i keep creating multiple instances of my countdown whenever i hit the button https://codepen.io/gxrobb/pen/zBvoRE
Moisés Man
@moigithub
Jun 24 2016 18:53
u can extrack images from that @Grizvok
Trevor Hunka
@Grizvok
Jun 24 2016 18:55
can i use jsonp with that call? ive noticed some calls are a little strange dealing with it
Moisés Man
@moigithub
Jun 24 2016 18:57
jsonp is used to bypass cross-origin error
Trevor Hunka
@Grizvok
Jun 24 2016 18:59
right, but when you dont have a server it can be a bit obnoxious to use json
the freecodecamp documentation even says to use it so
MikeBeers
@MikeBeers
Jun 24 2016 19:01
Please check Simon game
JD Tadlock
@jdtdesigns
Jun 24 2016 19:12
@gxrobb Here is an example of a start/stop http://jsbin.com/muhubus/edit?html,js,output
@MikeBeers It first started with 2, then it worked the second time but whenever you click a button during the sequence it starts another timeout or interval and throws errors. A good way to keep the user from causing errors is to disable the buttons during the sequence playback. ;)
Mark
@vinarius
Jun 24 2016 19:29

Hey! Looking for some help on exercise 232 Profile Look Up. Here is my code so far, can't figure out how to properly access the properties of the individual objects in the array.

//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];

function lookUpProfile(firstName, prop){
// Only change code below this line
for(var i=0; i < contacts.length; i++){
if(firstName !== contacts[i].firstName){
return "No such contact";
}
for(var j=0; j < contacts[i].length; j++){
if(prop !== contacts[i].number || prop !== contacts[i].likes){
return "No such property";
}
}
return contacts[i][firstName] + " " + contacts[i][prop];
}

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");

Robert Kregloh
@gxrobb
Jun 24 2016 19:33
@jdtdesigns thanks! i appreciate it
CamperBot
@camperbot
Jun 24 2016 19:33
gxrobb sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 564 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Thomas Burgess
@ThomasBurgess2000
Jun 24 2016 19:56
Anyone know why this is returning false?
function palindrome(str) {
  var removed=str.replace(/[^a-z]/,'');

  var lowered=removed.toLowerCase();

  var split=lowered.split('');
  var reversed=split.reverse();
  var join=reversed.join('');
  if (lowered==join) {
    return true;
  }
  return false;
}



palindrome("A man, a plan, a canal. Panama");
I think it has something to do with 'removed' but I'm not sure what
It works for other palindromes like '_eye'
Jonathan
@JonKaric
Jun 24 2016 19:59
@ThomasBurgess2000 Im not javascript expert but it seems like you need to put in the else statment after the if
Thomas Burgess
@ThomasBurgess2000
Jun 24 2016 19:59
what else statement?
Jonathan
@JonKaric
Jun 24 2016 19:59
so if (condition).... else (condition) {return false;}
Thomas Burgess
@ThomasBurgess2000
Jun 24 2016 20:00
Oh no I don't need to do that. It's returning false anyway, and I need it to return 'true' which is part of the if statement so it shouldn't be affected
I just added it anyway, and it's still not working @JonKaric
Husam
@7usam
Jun 24 2016 20:02
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Add to your form a set of three checkboxes. Each checkbox should be nested within its own label element. All three should share the name attribute of personality.
how do i do that
Jonathan
@JonKaric
Jun 24 2016 20:03
@ThomasBurgess2000 Like i said i dont know js that well. Id say just try sticking some console.logs in there to see if everything is outputting what youre expecting it to
@7usam what is the challenge name? i will quickly go through it and help you
Thomas Burgess
@ThomasBurgess2000
Jun 24 2016 20:04
Yeah.. Well, I did that and narrowed down the issue to my regular expression but not sure exactly what the issue is. Thanks anyway. @JonKaric
CamperBot
@camperbot
Jun 24 2016 20:04
thomasburgess2000 sends brownie points to @jonkaric :sparkles: :thumbsup: :sparkles:
:cookie: 109 | @jonkaric |http://www.freecodecamp.com/jonkaric
Husam
@7usam
Jun 24 2016 20:04
@JonKaric Create a Set of Checkboxes
miksDev
@miksDev
Jun 24 2016 20:04
@7usam replace radio with checkbox
Husam
@7usam
Jun 24 2016 20:05
@miksDev but this way the name of the checbox won't be personality as the challenge request
Jonathan
@JonKaric
Jun 24 2016 20:06
@7usam So first you need to change the type="radio" to type="checkbox"
miksDev
@miksDev
Jun 24 2016 20:06
<form action="">
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car<br>
<input type="checkbox" name="vehicle" value="Bus">I have a Bus
</form>
Jonathan
@JonKaric
Jun 24 2016 20:06
then change the name="indoor-outdoor" to name="personality"
miksDev
@miksDev
Jun 24 2016 20:06
share the same name right?
Jonathan
@JonKaric
Jun 24 2016 20:07
then copy and paste one line (the label and its input element) to make sure you have three
Husam
@7usam
Jun 24 2016 20:07
@JonKaric i did that still doesn't work @miksDev
Jonathan
@JonKaric
Jun 24 2016 20:07
@miksDev They seem like they do
<label><input type="checkbox" name="personality"> Indoor</label>
<label><input type="checkbox" name="personality"> Outdoor</label>
<label><input type="checkbox" name="personality"> Outdoor</label>
Husam
@7usam
Jun 24 2016 20:08
<form action="/submit-cat-photo">
<label><input type="checbox" name="personality"> Indoor</label>
<label><input type="checbox" name="personality"> outdoor</label>
<label><input type="checbox" name="personality"> both</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
Jonathan
@JonKaric
Jun 24 2016 20:08
@7usam missed out the K in checkbox
miksDev
@miksDev
Jun 24 2016 20:08
you misspelled checkbox
Husam
@7usam
Jun 24 2016 20:08
holly moly
@JonKaric @miksDev thanks a lot guys
CamperBot
@camperbot
Jun 24 2016 20:09
7usam sends brownie points to @jonkaric and @miksdev :sparkles: :thumbsup: :sparkles:
:cookie: 110 | @jonkaric |http://www.freecodecamp.com/jonkaric
:cookie: 39 | @miksdev |http://www.freecodecamp.com/miksdev
Husam
@7usam
Jun 24 2016 20:11
@JonKaric @miksDev by the way guys the challange did not ask to change the label (radio) to checkbox it just asks to add three checkboxes so why did you assume that it has to be changed ? why not only add ?
Jonathan
@JonKaric
Jun 24 2016 20:13
@7usam If the challenge asks for three checkboxes, its going to look to make sure you have those elements with the correct attributes. If you added instead of changed then youd probably still end up with the correct answer because thats all the challenge is looking for
miksDev
@miksDev
Jun 24 2016 20:13
Sorry :D it says add right, so there's no need to change or delete the radio
Jonathan
@JonKaric
Jun 24 2016 20:13
@7usam So, either way is correct but jus makes more sence to change instead of add them because youve already got the code there so might aswell use it :p
Husam
@7usam
Jun 24 2016 20:13
@JonKaric yeah .. i actually just tried that and it worked . thanks again
CamperBot
@camperbot
Jun 24 2016 20:13
7usam sends brownie points to @jonkaric :sparkles: :thumbsup: :sparkles:
:warning: 7usam already gave jonkaric points
MrTheHeck
@MrTheHeck
Jun 24 2016 20:20
So I get through a hundred lessons fairly easily and when I'm instructed to create a tribute webpage using everything I've learned, I blank on all of it. Is this normal for a new coder or does this mean I don't have a mind for coding? (I'm assuming/hoping this is at least semi-normal)
Part of it is the fact that "learning" something on these free coding websites usually means going through it once and moving on when I may need to do it fifty times for it to stick.
Keith
@Penderis
Jun 24 2016 20:22
@MrTheHeck it just means you have not repeated the same stuff enough for it to become like "muscle memory" in coding you will always refer to the docs for things you thought you knew until the day you just know them
Jonathan
@JonKaric
Jun 24 2016 20:23
@MrTheHeck So don't feel put down, most people when it comes to it find it hard to put the practice into real work
Marc White
@Shwrndasink
Jun 24 2016 20:23
Anyone here completed the Wikimedia viewer ?
MrTheHeck
@MrTheHeck
Jun 24 2016 20:24
I almost want to just go through those hundred or so lessons again before being put to the task of building something.
miksDev
@miksDev
Jun 24 2016 20:24
You dont have to remember every single code. If you know how it works that would be enough. you can always google the syntax tho
Marc White
@Shwrndasink
Jun 24 2016 20:24
@anyone
@everyone
@here
Jonathan
@JonKaric
Jun 24 2016 20:25
@MrTheHeck I'd say just go for it. Youll forget most of it anyway by the time youre done. i think building a real website is the most valuable thing you can do.
Marc White
@Shwrndasink
Jun 24 2016 20:25
@all
MrTheHeck
@MrTheHeck
Jun 24 2016 20:25
Thanks guys. That's what I needed to hear!
Jonathan
@JonKaric
Jun 24 2016 20:25
@Shwrndasink whats up marc?
Marc White
@Shwrndasink
Jun 24 2016 20:35
I cant get my ajax call to work in CodePen
It is working fine if I run in the console
J.S. Toy
@toymechqm
Jun 24 2016 20:35
uhhh ohhh
lets see it
Marc White
@Shwrndasink
Jun 24 2016 20:36
I am using jQuery.
J.S. Toy
@toymechqm
Jun 24 2016 20:36
nice
Is there a setting in CodePen that I need to adjust?
Or do I need a specific header value to input?
J.S. Toy
@toymechqm
Jun 24 2016 20:37
you said it works?
Marc White
@Shwrndasink
Jun 24 2016 20:38
If I run my code in the console
just not on codepen
J.S. Toy
@toymechqm
Jun 24 2016 20:38
ok
bear with me then
Marc White
@Shwrndasink
Jun 24 2016 20:38
var kw = $('#lookupValue').val(); var url = 'https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=' + kw; $.ajax({ url: url, dataType: 'jsonp', type: 'POST', headers: { 'Api-User-Agent': 'Example/1.0' }, success: function(data){ console.log(data); } });
J.S. Toy
@toymechqm
Jun 24 2016 20:38
okkk
hahah i figured oout one problem
Marc White
@Shwrndasink
Jun 24 2016 20:38
That sends back data in the console
Ok
J.S. Toy
@toymechqm
Jun 24 2016 20:38
wait nm
hey
do you have jquery ?
in your pen
Marc White
@Shwrndasink
Jun 24 2016 20:40
Yep
2.2.4
Try running the code above in the console. You will see it logs out the returned data on the 'POST' request
J.S. Toy
@toymechqm
Jun 24 2016 20:48
ok i have a clue
i figured it out but it leads you to problem #2
@Shwrndasink mark my main man you there?
Marc White
@Shwrndasink
Jun 24 2016 20:50
Yeah
J.S. Toy
@toymechqm
Jun 24 2016 20:50
<input type="submit" id="lookupTopic"/>
Marc White
@Shwrndasink
Jun 24 2016 20:51
Ok
J.S. Toy
@toymechqm
Jun 24 2016 20:51
do you know why this is a problem?
Marc White
@Shwrndasink
Jun 24 2016 20:51
Give me a couple min please
I want to look it up
J.S. Toy
@toymechqm
Jun 24 2016 20:51
sure
I suspect that there are a couple of moving parts here but, this my suggestion will actually lead to another problem
Marc White
@Shwrndasink
Jun 24 2016 20:52
Ok I am not sure.
It needs a value of "submit"?
J.S. Toy
@toymechqm
Jun 24 2016 20:53
well im actually confused a little but i changed that to this:
<button type="submit" id="lookupTopic"> submit</button>
however that leads me to this:
"XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=joshua. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
which is a whole other world of hurt
You find a lot of reading material about 'Access-Control-Allow-Origin'
CORS

Im confused about the submit thing though because I feel as thoug it shouldnt work. you might also need to add this:

event.preventDefault();

which in my mind should stop the page from submitting a form

you don't need a form
Marc White
@Shwrndasink
Jun 24 2016 20:57
Ok so it looks like you changed the input to a button and then just added the data format to 'json'?
J.S. Toy
@toymechqm
Jun 24 2016 20:58
I did? did I save on your pen?
if so that was not intended
I didnt really use codepen, i did it locally
JD Tadlock
@jdtdesigns
Jun 24 2016 20:58
@Shwrndasink Data format as json and returned as jsonp
Marc White
@Shwrndasink
Jun 24 2016 21:01
Ok cool.
I wonder what the difference is. Maybe I was doing it an older/dated way
?
Thanks @jdtdesigns and @toymechqm
CamperBot
@camperbot
Jun 24 2016 21:01
shwrndasink sends brownie points to @jdtdesigns and @toymechqm :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @toymechqm |http://www.freecodecamp.com/toymechqm
:cookie: 565 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Lars Kerick
@Brice187
Jun 24 2016 21:02
I need help with some positioning stuff of DOM Elements
Marc White
@Shwrndasink
Jun 24 2016 21:03
@Brice187 I will pay these kind folks help forward. What is your issue?
Lars Kerick
@Brice187
Jun 24 2016 21:05
when i add a <div>,it is added at a fixed position. This is alright, when i add an other <div> it is added at the same position and pushes the previous <div> and other elements to the top
i insert the code with .prepend(…)
Marc White
@Shwrndasink
Jun 24 2016 21:06
Where are you working? codepen?
On FCC?
Lars Kerick
@Brice187
Jun 24 2016 21:07
i use brackets and github, give me a second to upload to codepen
Marc White
@Shwrndasink
Jun 24 2016 21:07
Ok
Biazus
@Biazus
Jun 24 2016 21:08
can someone help with the wikipedia url?
but it is returning a weird json
JD Tadlock
@jdtdesigns
Jun 24 2016 21:10
@Biazus post your pen
JD Tadlock
@jdtdesigns
Jun 24 2016 21:14
@Biazus You just have an underscore at the end of your js that needs to be removed
other than that, it's returning the correct json
i would console.log() it instead to get a better look at it
Lars Kerick
@Brice187
Jun 24 2016 21:17
@Shwrndasink i want to have a fixed insert position where new <div elements> appear and previous inserted elements should be pushed down
i have to go now, but it would be very nice hearing from you in gitter :=
JD Tadlock
@jdtdesigns
Jun 24 2016 21:19
@Brice187 You don't need to use a form. A form will refresh the page when it submits and is not needed to get api data. Just use an input and a button.
Also, you're only returning one result so how are you testing multiple divs?
Lars Kerick
@Brice187
Jun 24 2016 21:24
When you press search button multiple times :)
JD Tadlock
@jdtdesigns
Jun 24 2016 21:36
@Brice187 You want to return a number of results based on the search, not add to the list each time. ;)
Marco Mazzeo
@Doko85
Jun 24 2016 21:37
@jdtdesigns sorry to bother you again, I made my icon switch check if current var "hours" is >= 6 && <= 18 for the daytime\nighttime icons
today around 6pm it worked, now it doesn't show anything
what do you think it's the problem? console logging the current time returns me 23:38 which is > 18
JD Tadlock
@jdtdesigns
Jun 24 2016 21:39
post the pen
JD Tadlock
@jdtdesigns
Jun 24 2016 21:44
@Doko85 You can't use if/else logic in a switch
you can use ternary's though
Also, you don't have the id for my current condition ;)
JD Tadlock
@jdtdesigns
Jun 24 2016 21:51
@Doko85 $('#icon').append(hours >= 6 && hours <= 18 ? "<i class='wi wi-day-rain'></i>  " : "<i class='wi wi-night-rain'></i>  "); is how you would do it inside the switch
Chris Santoso
@csantoso
Jun 24 2016 21:56
Hey! I'm having a bit of trouble using NPM to install a module ("Install a Module"). Every time I use the 'npm install <package>, I get an error saying that the package I try to install (linclark/pkg) is not an actual JSON. Any ideas?
JD Tadlock
@jdtdesigns
Jun 24 2016 22:01
@csantoso npm install @linclark/pkg
Chris Santoso
@csantoso
Jun 24 2016 22:02
That's what I've been trying, and it always seems to return an eror @jdtdesigns
Marc White
@Shwrndasink
Jun 24 2016 22:02
have you tried sudo npm install your-package?
Chris Santoso
@csantoso
Jun 24 2016 22:03
'$ sudo npm install @linclark/npm' doesn't seem to work right either....
Marc White
@Shwrndasink
Jun 24 2016 22:03
Are you on FCC?
Or local machine?
Chris Santoso
@csantoso
Jun 24 2016 22:03
I'm doing it through cloud9, the site FCC recommended we use
Marc White
@Shwrndasink
Jun 24 2016 22:05
Sorry I am not sure. i have to see what's happening better to understand
Chris Santoso
@csantoso
Jun 24 2016 22:05
Sure thing, let me see if I can show you
JD Tadlock
@jdtdesigns
Jun 24 2016 22:06
@csantoso It's an empty repos
she has nothing in the package
so it will return an error
Chris Santoso
@csantoso
Jun 24 2016 22:07
The instructions for the how-to-npm say to try to install that though... That's somewhat weird
I'm working on the first task under Node.js and Express.js
JD Tadlock
@jdtdesigns
Jun 24 2016 22:09
i don't see anything related to that package on the first task @csantoso
npm install -g how-to-npm is the command I believe you're supposed to run
Chris Santoso
@csantoso
Jun 24 2016 22:11
@jdtdesigns Under "Manage packages with npm", this task is #20, called "Complete 'Install a Module'"
Yep, and the how-to-npm program is a list of tasks under which "Install a Module" is located
JD Tadlock
@jdtdesigns
Jun 24 2016 22:14
you need to npm -g update how-to-npm
it's task 4 now
Marc White
@Shwrndasink
Jun 24 2016 22:14
are you having an issue with 'how-to-npm-verify'
JD Tadlock
@jdtdesigns
Jun 24 2016 22:14
@csantoso
Chris Santoso
@csantoso
Jun 24 2016 22:15
@jdtdesigns Yup, task 4 is the one
It was instructed that we update npm before we begin this, so the npm version I'm on is 3.10.2
flindip
@flindip
Jun 24 2016 22:19

I'm finishing up the "Local Weather App". Working on the convert to Fahrenheit button(going to work a display I think). But I'm getting an odd return on the Fahrenheit when I click the button. I guess my equation is wrong?

Here is the code:
http://codepen.io/flindip/pen/xOgbva

Daniel Cartín
@Danielcv93
Jun 24 2016 22:25
hi, can i declare a global variable inside a function?
JD Tadlock
@jdtdesigns
Jun 24 2016 22:26
@csantoso That crap is buggy lol. I got to the third one and did whoami and made the account and it still says incorrect
Or second one
Chris Santoso
@csantoso
Jun 24 2016 22:27
@jdtdesigns I got it working! It just happens that my package.json file was empty
crammatt
@crammatt
Jun 24 2016 22:33
hey all. im currently working on the build a personal portfolio project. can someone help me figure out how to add my social media buttos to my page?
Ghost
@ghost~56ef2a8b85d51f252ab9dec9
Jun 24 2016 22:34
@crammatt You should check font awesome icons!
@crammatt Here's an example : http://fontawesome.io/icon/twitter/
Daniel Cartín
@Danielcv93
Jun 24 2016 22:37
hi, can i declare a global variable inside a function?
Ghost
@ghost~56ef2a8b85d51f252ab9dec9
Jun 24 2016 22:38
@Danielcv93 Why would you want to declare a global variable inside a function? If you want to make a variable global, declare it at the beginning of your code :)
Marco Mazzeo
@Doko85
Jun 24 2016 22:39
@jdtdesigns what do you mean by "also you don't have the id for my current position"?
Heather Kusmierz
@HKuz
Jun 24 2016 22:41
@flindip Yeah, looks like you're using the F to C formula instead of a C to F (your temp is in C to start, so just change the formula to say var c = 9/5 * temp + 32; and it works.
JD Tadlock
@jdtdesigns
Jun 24 2016 22:42
@Doko85 my current condition
which is why you should just use the condition object they give you to display the condition text and icon
Marco Mazzeo
@Doko85
Jun 24 2016 22:43
it's based on your coords so of course it should be your condition :o:
:o
Niklas Hallberg
@gitHabbe
Jun 24 2016 22:44
Hey

why doesnt this center my text?

<div class="container">
<div class="row">
<div class="col-xs-12">
<h2 class="text-center">Neil Patrick Harris</h2>

JD Tadlock
@jdtdesigns
Jun 24 2016 22:45
@Doko85 What i'm saying is, you are getting the id and using a switch to display the condition icon. Just use the condition object they return in the api call that has the condition text and use the id to display the icon. No need for a switch.
Marco Mazzeo
@Doko85
Jun 24 2016 22:47
but wouldn't that return me their ugly icons instead?
Niklas Hallberg
@gitHabbe
Jun 24 2016 22:51
omg nvm, I entered wrong bootstrap
96street
@96street
Jun 24 2016 22:51
Why isn't my 2nd div center aligned http://codepen.io/kingdezz/pen/yJgoNN
flindip
@flindip
Jun 24 2016 22:54
@HKuz yeah, I fixed in between waiting. Minor oversight on my part. Thanks for looking at it though
CamperBot
@camperbot
Jun 24 2016 22:54
flindip sends brownie points to @hkuz :sparkles: :thumbsup: :sparkles:
:cookie: 392 | @hkuz |http://www.freecodecamp.com/hkuz
Marco Mazzeo
@Doko85
Jun 24 2016 22:54
@jdtdesigns I understand that you are suggesting me to access their condition objects to return the icons but I don't get how doing that would help me return the icons I want to use... I'm actually accessing their object through the ID though, I thought that would work better than by the description text
also if I didn't use the switch I wouldn't have learnt about the ternary syntax
flindip
@flindip
Jun 24 2016 22:55

@HKuz Its almost finished I just need to figure out what I want to do with the button.

http://codepen.io/flindip/pen/xOgbva

Heather Kusmierz
@HKuz
Jun 24 2016 22:58
@flindip yeah, looks good and worked fine for my location - nice job. I think I put my button right next to where the temp displays on the page, but really it could go anywhere. You may want to just round the temps (Math.round(temp)) to display them, it's showing 3+ decimals now for me.
flindip
@flindip
Jun 24 2016 23:00
@HKuz I mean its REALLY basic. Its something I wanna rework down the road. But, I'll hit all the requirements and move on.
Marco Mazzeo
@Doko85
Jun 24 2016 23:01
@flindip I'd style it a bit more, maybe with some semi-transparent boxes
flindip
@flindip
Jun 24 2016 23:01
@HKuz But, the project gave me a better idea on how this stuff communicates. Also is it responsive for you? I've always had a tough time with bootstrap
@Doko85 yeah, I'll work in icons at some point...
Marco Mazzeo
@Doko85
Jun 24 2016 23:01
also your button converts the temperature inside the button and not the one displayed on the page
which is not the assignment I suppose
Lyba M
@lybamahenti
Jun 24 2016 23:02
@96street add this (margin-left:440px;) inside #search {)
Marco Mazzeo
@Doko85
Jun 24 2016 23:02
and, btw, use Math.floor to round the temperature number
flindip
@flindip
Jun 24 2016 23:02
@Doko85 I know. The button isn't finished
Marco Mazzeo
@Doko85
Jun 24 2016 23:02
you said you didn't know what to do with it... I was suggesting ^^
96street
@96street
Jun 24 2016 23:02
isn't there an easier way to center align? @lybamahenti that method won't be responsive across different screens
margin: 0 auto should be working but it's not
flindip
@flindip
Jun 24 2016 23:04
@Doko85 @HKuz thanks. I'm going to take a break and do the last steps tonight. Probably won't take me more than an hour
CamperBot
@camperbot
Jun 24 2016 23:04
flindip sends brownie points to @doko85 and @hkuz :sparkles: :thumbsup: :sparkles:
:warning: flindip already gave hkuz points
:cookie: 400 | @doko85 |http://www.freecodecamp.com/doko85
Marco Mazzeo
@Doko85
Jun 24 2016 23:05
it really depends on how much in depth you want to go
I'd say mine is finished since a few days but I wanted to add more features and I'm trying to understand how to add more
like max-min temp, sunrise and sunset times...
flindip
@flindip
Jun 24 2016 23:08
@Doko85 I'm going to make more sophisticated down the road. I found when I was more ambitious with the first two projects I ended up spending too much time on older methods. You will learn more tools as you go that will make reworking the projects easier. I think it just depends on how you want to approach it.
Heather Kusmierz
@HKuz
Jun 24 2016 23:09
@flindip Ok, sounds good. I take the same approach - I remember thinking the first few challenges were so hard and now I look back and cringe a bit on how I did them. Oh well. As for responsive, it is, when I really mushed the screen (think super small breakpoint) it seems to keep a left margin instead of using all the width space of the screen. One quick fix I played with is you can remove the margin-left code in your CSS (replace with margin: auto; BEFORE your margin top code, this will generally center things horizontally), use a col-xs-12. May need to play with it a bit more - I've found centering columns in Bootstrap can be tricky depending on content.
flindip
@flindip
Jun 24 2016 23:09
@HKuz yeah, well, at least its an improvement.
Tommy Izen
@TommyIzen
Jun 24 2016 23:29
@TommyIzen
Hi people. I am coming to grips with Bootstrap, like how do I put other elements inside of a row?
I am thinking of just using container-fluid and row-fluid and my own custom css
that worked out nicely last time