These are chat archives for FreeCodeCamp/HelpFrontEnd

8th
Apr 2016
Bruce Young
@mutantspore
Apr 08 2016 00:03
@gpressman json.weather[0].description
it’s in a one element array
chaukrau
@chaukrau
Apr 08 2016 00:04
http://codepen.io/hallaathrad/full/vNEPpL is there a tutorial on how I can link to certain places on a page? like with this pen?
chaukrau
@chaukrau
Apr 08 2016 00:20
haha I figured it out, what do y'all think? http://codepen.io/chaukrao/pen/pyprOj
Ogundele Olumide
@Lumexralph
Apr 08 2016 00:38
cool @chaukrau
Pawan
@pawan92
Apr 08 2016 00:38
@sjames1958gm thanks!!!!
CamperBot
@camperbot
Apr 08 2016 00:38
pawan92 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 499 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
LuciusR11
@LuciusR11
Apr 08 2016 00:39
 (document).ready(function() {
  ("#getQuote").on("click", function() {
  (".quote").html("Fear is the mind killer");    
  });
});
I'm on the random quote generator challenge, anyone know why this won't change my text when I click the button that is supposed to change it?
Gabe Pressman
@gpressman
Apr 08 2016 00:40
@mutantspore I see, thanks again
Ogundele Olumide
@Lumexralph
Apr 08 2016 00:50
why do I keep being asked to 'Please complete the security check to access www.freecodecamp.com' ? anyone experiencing this? how can I stop it?
wonsi
@wonsi
Apr 08 2016 00:51
There's no $ in front of your elements
ex $("#getQuote")
LuciusR11
@LuciusR11
Apr 08 2016 00:52
Even with the $ they won't work.
Bruce Young
@mutantspore
Apr 08 2016 00:52
@LuciusR11 do you have jquery added in
LuciusR11
@LuciusR11
Apr 08 2016 00:53
Thanks @mutantspore , I should have realized that
CamperBot
@camperbot
Apr 08 2016 00:53
luciusr11 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1369 | @mutantspore | http://www.freecodecamp.com/mutantspore
EternityElephant
@EternityElephant
Apr 08 2016 00:54
does anyone know how to do the icons for the weather app? or where to find them
wonsi
@wonsi
Apr 08 2016 00:56
I've started on the Weather app today. Can't figure out why navigator.geolocation only works in firefox and not chrome.
Ogundele Olumide
@Lumexralph
Apr 08 2016 00:57
@EternityElephant try this link if it'll help https://fortawesome.github.io/Font-Awesome/icons/
ehekatlOf
@ehekatlOf
Apr 08 2016 01:08
@EternityElephant can't you just use the built in ones with the weather api?
that way you can just reference the icon property that it returns
EternityElephant
@EternityElephant
Apr 08 2016 01:12
oh i didnt realize it had that thank you
ehekatlOf
@ehekatlOf
Apr 08 2016 01:13
all good
wonsi
@wonsi
Apr 08 2016 01:23
Is there a work around to get navigator.geolocation's getCurrentPosition to work in Chrome? The console gives an error that it is deprecated on non https: sites
EternityElephant
@EternityElephant
Apr 08 2016 01:32
@ehekatlOf i just got the api to return the icon but its just a few letters/numbers?
example: "04n"
EternityElephant
@EternityElephant
Apr 08 2016 01:38
i figured it out, thats the end part of a png url
Pawan
@pawan92
Apr 08 2016 01:46
ok im back. can someone tell me how to float my results to the left? and also how to be able to search again after searching first time.
http://codepen.io/pawan92/pen/zqzWYB
Joe Narvaez
@wordyallen
Apr 08 2016 01:54
sometimes I wanna cry when I see peopel strugglign with bootstrap
I dont' understand why cats dont fux with the flexbox
at the very least be down that bulma.io
spending hours trying to center things with xs-col-2 col-left-3 orwhatever
and it aint even that nice looking
whatever
and plus you gott throw jquery in too?
total dealbreaker
Elbert Cortez
@trip16661
Apr 08 2016 02:08

   function geoLoc() {
       var Userlocation = 0;
       if (!navigator.geolocation) {
           alert("Error: GeoLocation is not supported by your browser")
           return;
       }

       function success(position) {
           var userLatitude = position.cords.latitude;
           var userLongitude = position.cords.longgitude; 
       }
       function error() {
           alert("Error: Unable to obtain your location")

       } 
       navigator.geolocation.getCurrentPosition(success,error)
   };
   geoLoc();
am i doing anything wrong?
Bruce Young
@mutantspore
Apr 08 2016 02:11
@trip16661 position.cords.longgitude
Elbert Cortez
@trip16661
Apr 08 2016 02:11
oh y
but still does nothing D:
Bruce Young
@mutantspore
Apr 08 2016 02:12
from memory is it coords
@trip16661 position.coords.longitude
Elbert Cortez
@trip16661
Apr 08 2016 02:13
@mutantspore thanks
mevloy
@mevloy
Apr 08 2016 02:14
Hello! I'm working on spacing with bootstrap but I can't seem to quite get things right. I'd like all of the red elements to be the same height, 100%, filling the entire .run div. The first div is spaced perfectly, but the remaining 3 red divs have extra space below. Any ideas what's going wrong? (I've bordered the problem elements in red for clarity)
Elbert Cortez
@trip16661
Apr 08 2016 02:14
but still not loading
wonsi
@wonsi
Apr 08 2016 02:14
@trip16661 Are you using Chrome?
Elbert Cortez
@trip16661
Apr 08 2016 02:14
yes
wonsi
@wonsi
Apr 08 2016 02:15
When I inspect the console in codepen, it tells me that getCurrentPosiiton is deprecated . It works fine for me in firefox though.
Elbert Cortez
@trip16661
Apr 08 2016 02:17
umm i used it on firefox and it doesn't work there xD
does it display the code in an alert box?
wonsi
@wonsi
Apr 08 2016 02:17
I had it displaying in both a div and in the console in firefox. Chrome: Nothing
Elbert Cortez
@trip16661
Apr 08 2016 02:19
I see D:
wonsi
@wonsi
Apr 08 2016 02:27
Here's the code I used```<script>
$(document).ready(function(){
    if (navigator.geolocation) {
      console.log('Geolocation is supported!');
    }
    else {
      console.log('Geolocation is not supported for this Browser/OS version yet.');
    }

    navigator.geolocation.getCurrentPosition(function(position){

  $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);

  console.log("latitude: " + position.coords.latitude + " longitude: " + position.coords.longitude);

    });      
});

</script>```
rocng
@rocng
Apr 08 2016 02:30
@thedancingslug It looks like it's because the font sizes are different for the red elements. .main-txthas font size set to 32px, but the first div is at the default size. If you set them to the same font size, they should be the same height. Alternatively, you can set line-height to be the same for all of them if you wanted the font sizes to be different.
mevloy
@mevloy
Apr 08 2016 02:34
@rocng perfect! thanks for the help!
CamperBot
@camperbot
Apr 08 2016 02:34
thedancingslug sends brownie points to @rocng :sparkles: :thumbsup: :sparkles:
:star: 326 | @rocng | http://www.freecodecamp.com/rocng
rocng
@rocng
Apr 08 2016 02:35
@thedancingslug No problem, glad I could help!
yhakong
@yhakong
Apr 08 2016 03:45
@SandraFlato Yes, I did. Thanks for asking
CamperBot
@camperbot
Apr 08 2016 03:45
yhakong sends brownie points to @sandraflato :sparkles: :thumbsup: :sparkles:
:star: 301 | @sandraflato | http://www.freecodecamp.com/sandraflato
Brian
@BrianCodes33
Apr 08 2016 04:14
so i have someone that needs help updating their site on bluehost. can i just login to bluehost and start editing or do i need to do domain.com/wp-admin?
Dakota Bryant
@dakotabryant
Apr 08 2016 04:22
Can anyone help me with ideas as to why my H1 in this gif is being pushed up in to my navbar?
Spas
@Spasmochi
Apr 08 2016 04:47
Hey guys, I'm stuck on the weather app project and was wondering if someone could take a look at my JS and maybe point me in the right direction? My pen is here , I've been able to get a response from the server, and access elements of the returned object. My problem is passing my lat and lon parameters.
random-x
@random-x
Apr 08 2016 04:57
alright, I do have some renewed respect for people who do pretty things using bootstrap. it's actually kind of a pain :P
Dakota Bryant
@dakotabryant
Apr 08 2016 04:58
Ha, is that in regards to mine?
Leah H
@leah-h
Apr 08 2016 04:58
@BrianCodes33 if they have wordpress installed then you can make your changes via /wp-admin you install wordpress by logging onto bluehost
random-x
@random-x
Apr 08 2016 04:59
@dakotabryant no, I was just doing something far simpler than that and it has taken me forever
Dakota Bryant
@dakotabryant
Apr 08 2016 04:59
It really is a powerful framework though
random-x
@random-x
Apr 08 2016 04:59
indeed... but a pain in the butt, counting the right offsets, clearing when needed, setting visible or hidden..
it seems soooooooo manual
Mark Little
@MarkBLittle
Apr 08 2016 05:01
@Spasmochi is there a way to PM on this? I'd like to try to help you out
random-x
@random-x
Apr 08 2016 05:01
like "test at this size. make adjustment. ok, now this size. adjustments. now this size. adjustments. COOL!"
and after all that work, I don't know if I want to push/pull instead or just leave it how I have it and :'(
Spas
@Spasmochi
Apr 08 2016 05:05
@MarkBLittle Not sure, I don't think we can.
random-x
@random-x
Apr 08 2016 05:06
@MarkBLittle @Spasmochi hover over another user's picture and a pop-up will appear... you can choose "chat privately"
Spas
@Spasmochi
Apr 08 2016 05:06
@random-x thanks!
CamperBot
@camperbot
Apr 08 2016 05:06
spasmochi sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
Mark Little
@MarkBLittle
Apr 08 2016 05:06
Thanks, @random-x
CamperBot
@camperbot
Apr 08 2016 05:06
:star: 127 | @random-x | http://www.freecodecamp.com/random-x
:star: 128 | @random-x | http://www.freecodecamp.com/random-x
markblittle sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
random-x
@random-x
Apr 08 2016 05:06
np :)
Spas
@Spasmochi
Apr 08 2016 05:35
@MarkBLittle Thanks to Mark for the awesome help!
CamperBot
@camperbot
Apr 08 2016 05:35
spasmochi sends brownie points to @markblittle :sparkles: :thumbsup: :sparkles:
:star: 277 | @markblittle | http://www.freecodecamp.com/markblittle
wonsi
@wonsi
Apr 08 2016 05:57
Can anyone help me with my weather app? I can't get a response when using Chrome

```if (navigator.geolocation) {
console.log('Geolocation is supported!');
}
else {
console.log('Geolocation is not supported for this Browser/OS version yet.');
}

navigator.geolocation.getCurrentPosition(function(position){

$("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);

console.log("latitude: " + position.coords.latitude + " longitude: " + position.coords.longitude);

});      

});

I also can't seem to format code here properly.
kirbyedy
@kirbyedy
Apr 08 2016 06:12
@wonsi link your pen please
wiki format
CamperBot
@camperbot
Apr 08 2016 06:12

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Paul Borawski
@iAmNawa
Apr 08 2016 06:12
Hello world!
CamperBot
@camperbot
Apr 08 2016 06:12

welcome to FreeCodeCamp @iAmNawa!

kirbyedy
@kirbyedy
Apr 08 2016 06:21
hmmm location is showing correctly for me
in the browser and in the console as well
wonsi
@wonsi
Apr 08 2016 06:22
Are you using chrome or firefox?
kirbyedy
@kirbyedy
Apr 08 2016 06:22
chrome
wonsi
@wonsi
Apr 08 2016 06:23
So I need to throw out my computer then. :D
I have location settings to ask to allow sites to know my location
kirbyedy
@kirbyedy
Apr 08 2016 06:23
can you check you settings
is this working for you
do you get the correct weather
wonsi
@wonsi
Apr 08 2016 06:25
yes that worked
kirbyedy
@kirbyedy
Apr 08 2016 06:26
well thats strange
if there is a problem with your location settings, normally it should not work
wonsi
@wonsi
Apr 08 2016 06:27
When I went into dev tools and checked the console (not codepens console) I get a warning that getCurentposition is deprecated on unsecure origins
kirbyedy
@kirbyedy
Apr 08 2016 06:29
yes
apparently in the future versions of chrome it will be disabled
I mean all this location thingys will have to go over https
if I understood that well
wonsi
@wonsi
Apr 08 2016 06:30
Yeah I think maybe they just got to me first :D
kirbyedy
@kirbyedy
Apr 08 2016 06:31
:D
wonsi
@wonsi
Apr 08 2016 06:31
I guess I'll just do this project in firefox for now and try to work out the problem later
thanks
kirbyedy
@kirbyedy
Apr 08 2016 06:31
my console log says the same thing but its working for some reason
well you can try to clear the cache, restart...
no other ideas
wonsi
@wonsi
Apr 08 2016 06:32
Thanks
Typhic
@Typhic
Apr 08 2016 06:39
Hey guys, I need help figuring out how to center both links in the footer of my portfolio: http://codepen.io/Typhic/full/wGpwqW/
Paul Borawski
@iAmNawa
Apr 08 2016 06:41
@Typhic

footer {

text-align: center;
}
Typhic
@Typhic
Apr 08 2016 06:43
@iAmNawa I tried it but it's still off by a bit, I'm assuming because of the invisible bullets since it's a <ul>
Paul Borawski
@iAmNawa
Apr 08 2016 06:44
<div id=footer>
    <ul id=footer-buttons>
  <li style="text-align: center;">Around The Web</li>

      <li><a href="https://github.com/Typhic" target=_blank>GitHub</a></li>
      <li><a href="https://www.freecodecamp.com/typhic" target=_blank>freeCodeCamp</a></li>
    </ul>
</div>
boom
@Typhic
make them all list items or none of them
wonsi
@wonsi
Apr 08 2016 06:46
Yahtzee!! I was able to get my pen to work in Chrome. Had to click on the page icon in the address bar (some sites it looks like a lock) and change the permissions there.
Typhic
@Typhic
Apr 08 2016 06:46
@iAmNawa I see what you did but it actually isn't centered when you look at is more closely.
*it
I figured it out. You put padding: 0px and margin: 0px addressing #footer-buttons
oh btw guys how do I put text like in chat to look like code
Paul Borawski
@iAmNawa
Apr 08 2016 06:49
@Typhic
<div id=footer>
    <h4 style="text-align: center;">Around The Web</h4>
    <div id=footer-buttons>
      <p><a href="https://github.com/Typhic">GitHub</a></p>
      <p><a href="https://www.freecodecamp.com/typhic">freeCodeCamp</a></p>
    </div>
</div>
press three of these `
and press enter, ebter your code, then press command enter
back ticks
Typhic
@Typhic
Apr 08 2016 06:50
<p>test</p>
cool thanks @iAmNawa
CamperBot
@camperbot
Apr 08 2016 06:51
typhic sends brownie points to @iamnawa :sparkles: :thumbsup: :sparkles:
:star: 356 | @iamnawa | http://www.freecodecamp.com/iamnawa
Typhic
@Typhic
Apr 08 2016 06:51
also the way with <p> works too because they're not starting as a list but since it's a paragraph it puts a bit more space between the links
Paul Borawski
@iAmNawa
Apr 08 2016 06:52
you can adjust that space with css
Typhic
@Typhic
Apr 08 2016 06:53
woah you just messaged me but not in chat wtf?
Paul Borawski
@iAmNawa
Apr 08 2016 06:54
CORRECT
Typhic
@Typhic
Apr 08 2016 07:03
Okay so I think my last main problem with my portfolio right now is that when you click a link on the navigation bar it pulls you to the right place, but the title of the section will be a bit behind the navbar. How can I make it so it'll link me to where the very top of the relevant div is touching the bottom of the navbar? http://codepen.io/Typhic/full/wGpwqW/
Paul Borawski
@iAmNawa
Apr 08 2016 07:06
try targeting the container
rather than the word
Typhic
@Typhic
Apr 08 2016 07:06
I don't think I have a container
Paul Borawski
@iAmNawa
Apr 08 2016 07:06
That’s probably the issue
every new section on a page should be in a container
Typhic
@Typhic
Apr 08 2016 07:07
why?
Typhic
@Typhic
Apr 08 2016 07:14
I put containers and col-xs-12 and now it's all messedup
Typhic
@Typhic
Apr 08 2016 07:21
I'm just gonna do pure html/css for now and work on updating it to bootstrap later on
V Arun Kumar
@arunvkumr
Apr 08 2016 07:21
@Typhic try adding padding-top: 50px;
inside this css elem ..
#bio, #portfolio, #contact {
  border: 1px solid #b35900;
  padding-top:50px; //<- this one
}
Could anyone take a look at my pen and help me with an issue?
For some reason, my content in my header isn't staying inside the div, and flowing over to the next/previous divs instead of just expanding
usharya
@usharya
Apr 08 2016 07:32
why is the hover effect not working?
a.btn:hover {
background-color: white;
}
I created the button with <a> tags with the btn class
kirbyedy
@kirbyedy
Apr 08 2016 07:33
@dakotabryant fittext ?
MichaelTsang
@MichaelTsang
Apr 08 2016 07:47
anybody help plz..
i am working on quote machine, and i don't know how to link json
$.getJSON("/json/cats.json" , what should i do in codePen
kirbyedy
@kirbyedy
Apr 08 2016 08:06
@MichaelTsang http://forismatic.com/en/api/ for example
MichaelTsang
@MichaelTsang
Apr 08 2016 08:08
@kirbyedy thanks
CamperBot
@camperbot
Apr 08 2016 08:08
michaeltsang sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 817 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Rada
@Radascript
Apr 08 2016 08:31
hey guys!
Can someone give advice on how to tweak my code to get BOTH SIDES of column to light up when I hover over one? When I try to use a:hover{background-color: white;} it doesn't do anything, even though when I do a:hover{color:red;} it changes font color just fine.
CSS lines 42-50, JS lines 1-29.
http://codepen.io/RadaCodes/pen/ONzVdb
Jackson
@jacksonbrim
Apr 08 2016 08:41
Hey, what api did you all use for your quote machine?
kirbyedy
@kirbyedy
Apr 08 2016 08:43
@jacksonbrim there is plenty to choose from
forismatic, famous quotes, quotes on design
chuck norris fun quotes :D
Jackson
@jacksonbrim
Apr 08 2016 08:44
@kirbyedy Yeah I had seen some of those. Idk, I'm just having a bit of trouble understanding it, I guess.
@kirbyedy thanks, though.
CamperBot
@camperbot
Apr 08 2016 08:44
jacksonbrim sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 818 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
kirbyedy
@kirbyedy
Apr 08 2016 08:46
@jacksonbrim for example if you look at forismatic, there is an example, so you can pretty much take the api call from there and adjust it to your needs
@Radascript not sure if you can sort that out with a hover, cause those divs have different names
@Radascript maybe if you wrap both divs into a href, try it
Rada
@Radascript
Apr 08 2016 08:51
@kirbyedy they are actually both in the same href, that's why I don't get why it's not letting me do that
kirbyedy
@kirbyedy
Apr 08 2016 08:58
hmm
Randy Goldsmith
@Dueldrawer8
Apr 08 2016 09:01
ive been looking at how to set up Wikipedias api for two days.. just dont really get it. Instead of getting certain data.. i just want to get ALL the data or basically just create a link to the page itself
so when i do a search for example of "steak", i guess i need the api to help me return up to a certain limit with the title steak.. and i want it to return all titles with steak in it and whenever i click on each of those links, it brings me to the full wikipedia page
kirbyedy
@kirbyedy
Apr 08 2016 09:03
@Radascript the only idea I have is to merge those cells, so you will have same attributes for them, right now, its separate so that might be causing the problem
Randy Goldsmith
@Dueldrawer8
Apr 08 2016 09:15
so which data value would i want to access to get the whole page here
hnry
@hnry
Apr 08 2016 09:31

@Radascript

  $('.nameOff').hover(function() {
    $(this).parent().children().toggleClass('selectedOff');
  });

i think that's what you're trying to do

also i believe that's not valid html embedding div inside a <a>, you're better off taking another approach to do that stuff
Dardan Demiri
@dardandemiri
Apr 08 2016 10:00
@Dueldrawer8 what do you mean the whole page
the whole article content ?
Elbert Cortez
@trip16661
Apr 08 2016 10:06
what icons did you guys use for the weather app?
Dardan Demiri
@dardandemiri
Apr 08 2016 10:06
It doesn't mater you can use whatever icon you like
Stephen James
@sjames1958gm
Apr 08 2016 10:07
@trip16661 Inside the json response there is a icon: property and the value is the name of a icon file. Let me check my code for the url
Dardan Demiri
@dardandemiri
Apr 08 2016 10:07
or you can search in google for Weather Icons Pack
For more beautiful icons. @trip16661
Stephen James
@sjames1958gm
Apr 08 2016 10:08
@trip16661 "http://openweathermap.org/img/w/" + result.weather[0].icon + ".png"
Elbert Cortez
@trip16661
Apr 08 2016 10:12
oh so they have their own icons
Stephen James
@sjames1958gm
Apr 08 2016 10:12
@sjames1958gm - yeah
Dardan Demiri
@dardandemiri
Apr 08 2016 10:13
var src = "http://openweathermap.org/img/w/" + result.weather[0].icon + ".png";
$("#weatherIcon").attr("src", src);
Elbert Cortez
@trip16661
Apr 08 2016 10:13
i saw some icons on google but they were in css format
Dardan Demiri
@dardandemiri
Apr 08 2016 10:13
@trip16661
V Arun Kumar
@arunvkumr
Apr 08 2016 10:14
hey guys.. i'm working on twitch api and i want to remove the white line bellow the tabs.. can someone help me? codepen link
Stephen James
@sjames1958gm
Apr 08 2016 10:21
@arunkumrv the border comes from bootstrap - .nav-tabs.nav-justified>li>a { border-bottom: 1px solid #ddd; }
Dardan Demiri
@dardandemiri
Apr 08 2016 10:21
.nav-tabs.nav-justified>li>a {
    border-bottom: 0px solid #ddd;
    border-radius: 4px 4px 0 0;
}
@arunkumrv
or delete that row
:P @sjames1958gm we respond like a mirror :P at the same time
hahahah
Stephen James
@sjames1958gm
Apr 08 2016 10:22
@dardandemiri :+1:
Dardan Demiri
@dardandemiri
Apr 08 2016 10:23
@arunkumrv If you want to know in the future how to change things in your css
you just use the Inspect Element
in your browser

and than Ctrl+Shfit+C

You grab the selector and select your problem and it tells you what is causing it

V Arun Kumar
@arunvkumr
Apr 08 2016 10:25
@dardandemiri @sjames1958gm thanks. :smile:
CamperBot
@camperbot
Apr 08 2016 10:25
arunkumrv sends brownie points to @dardandemiri and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 282 | @dardandemiri | http://www.freecodecamp.com/dardandemiri
:star: 503 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
V Arun Kumar
@arunvkumr
Apr 08 2016 10:25
@dardandemiri thanks for the info i'll keep in mind.
CamperBot
@camperbot
Apr 08 2016 10:25
arunkumrv sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:warning: arunkumrv already gave dardandemiri points
Stephen James
@sjames1958gm
Apr 08 2016 10:26
devtools are your friend :)
Dardan Demiri
@dardandemiri
Apr 08 2016 10:26
You are welcome
;)
Savio Jomton
@enigma0160
Apr 08 2016 10:41
Hello, I`m working on the wikipedia searcher, how can i get the text contained within the searchbox when a user presses enter, my text box is not within a form tag and there is not search(submit) button
http://codepen.io/enigma0160/pen/growEy
Stephen James
@sjames1958gm
Apr 08 2016 10:42
@enigma0160 to get the text use $("selector").val();
@enigma0160 Is your question how to know when they press enter?
Savio Jomton
@enigma0160
Apr 08 2016 10:43
@sjames1958gm I want to get the input when they press enter, because i dont want to place a separate search button
Stephen James
@sjames1958gm
Apr 08 2016 10:43
@enigma0160 So you want to know how to trigger on enter?
Abhishek K Das
@AbKDs
Apr 08 2016 10:44
hello people
Stephen James
@sjames1958gm
Apr 08 2016 10:44
@sjames1958gm
  $("#search").on("keydown", function(e) {
    if (e.keyCode == 13) {
      e.preventDefault();
      handleSearch();
    }
  });
Abhishek K Das
@AbKDs
Apr 08 2016 10:44
I need help regarding a basic thing
How to fade out a color
Savio Jomton
@enigma0160
Apr 08 2016 10:45
.val() returns undefined even though textbox contains text
Abhishek K Das
@AbKDs
Apr 08 2016 10:45
I mean suppose there is a digital clock which is on, so the digits would be say kinda glowing
when it is switched off I want a pretty dull shade
how to achieve that kind of affect, any pointers ?
Let's take the "on" color to be red
what would look good when it's "off"
Stephen James
@sjames1958gm
Apr 08 2016 10:47
@enigma0160 Do you have a link?
@enigma0160 I assume you are using jquery with jquery included
Savio Jomton
@enigma0160
Apr 08 2016 10:49
@sjames1958gm Thank you! that did the trick!
CamperBot
@camperbot
Apr 08 2016 10:49
enigma0160 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 505 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Apr 08 2016 10:53
@enigma0160 :+1:
Zoher Ali
@Zoher-ali
Apr 08 2016 10:58
plz sm1 help me with weather app. i dont know how to get temperature data from open weather api
here is my code
<script>
    function weather(){
        document.write("jquery loaded");
        $.getJSON("http://api.openweathermap.org/data/2.5/weather?q=London",function(json){
                                                                                         document.write(JSON.stringify(json));
                                                                                     });
    }
</script>
</head>

<body>
<button onclick="weather()">Get Weather</button>
</body>
Greg Duncan
@GregatGit
Apr 08 2016 11:08
@Zoher-ali is your json correct
Samuel Cupidon
@Zerazera
Apr 08 2016 11:08
@Zoher-ali If your json imported correctly you can get its data using dot or bracket notation
Zoher Ali
@Zoher-ali
Apr 08 2016 11:08
yes i had checked it @GregatGit
@Zerazera how?
Greg Duncan
@GregatGit
Apr 08 2016 11:09
@Zoher-ali It doesn't look like you have regeistered at openweather
you should have api key
var appid = //what ever open weather key gives you
var url = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&appid=" + appid;
function weather(){
        document.write("jquery loaded");
        $.getJSON("url, function(json){
                  document.write(JSON.stringify(json));
                  });
    }
Greg Duncan
@GregatGit
Apr 08 2016 11:15
this is not 100% - its missing some brackets but your url should look something like this
Zoher Ali
@Zoher-ali
Apr 08 2016 11:21
@GregatGit ok :+1: i got details ... Now how to fetch single temperature from it?
@GregatGit i have written something like this
$('#div').text(response.main.temp);
Bruce Young
@mutantspore
Apr 08 2016 11:29
@Zoher-ali and? it doesn’t work ?
Zoher Ali
@Zoher-ali
Apr 08 2016 11:30
@mutantspore no :-1:
Bruce Young
@mutantspore
Apr 08 2016 11:31
wel can we see your pen? you wil need to have that line inside the getjson or called in a function from inside
Zoher Ali
@Zoher-ali
Apr 08 2016 11:32
@mutantspore well i am doing it on dreamweaver
Bruce Young
@mutantspore
Apr 08 2016 11:33
ok … is that line within the getjson success function?
hard to help like this
Zoher Ali
@Zoher-ali
Apr 08 2016 11:33
here is my code anyways
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!--<script src="https://api.openweathermap.org/data/2.5/weather?lat=35&lon=139"></script>-->
<script>
    function weather(){
        document.write("jquery loaded");
        $.getJSON("http://api.openweathermap.org/data/2.5/weather?q=London&APPID=f481ef3ea3d740305a4cc4ea5b6a74d4",function(json){
                                                                                         document.write(JSON.stringify(json));
                                                                                        //var data = JSON.stringify(json);
                                                                                        //document.write(data.main.temp);

                                                                                     });
    }

</script>
</head>

<body>
<button onclick="weather()">Get Weather</button>
<div id="div"></div>
</body>
</html>
Bruce Young
@mutantspore
Apr 08 2016 11:35
@Zoher-ali so this works document.write(JSON.stringify(json));
??
Zoher Ali
@Zoher-ali
Apr 08 2016 11:36
yes @mutantspore it displayed all data of json
Bruce Young
@mutantspore
Apr 08 2016 11:36
you also don’t need to stringify the son.. that’s only usefull to show teh object as a whole on a page
json.main.temp will get you your temp
kirbyedy
@kirbyedy
Apr 08 2016 11:37
this works correctly
Bruce Young
@mutantspore
Apr 08 2016 11:37
$('#div’).html(json.main.temp);`
kirbyedy
@kirbyedy
Apr 08 2016 11:37
al least in my codepen, I just tried it
Zoher Ali
@Zoher-ali
Apr 08 2016 11:40
document.write(json.main.temp);
it worked @mutantspore
thanx @mutantspore @kirbyedy
CamperBot
@camperbot
Apr 08 2016 11:42
zoher-ali sends brownie points to @mutantspore and @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 1372 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 819 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
jonah-butler
@jonah-butler
Apr 08 2016 12:51
Hey, everyone.
I've got a formatting issue with my tribute page I can't seem to resolve.
Any ideas on this would be super!
kirbyedy
@kirbyedy
Apr 08 2016 12:51
would help if we could see your code :D
since your monitor is a bit far from here where I sit :D
jonah-butler
@jonah-butler
Apr 08 2016 12:52
(you're supposed to just know of course)
Stephen James
@sjames1958gm
Apr 08 2016 12:52
@kirbyedy :clap:
jonah-butler
@jonah-butler
Apr 08 2016 12:53
my <ul> needs to be formatted center like the example were given, but no combination of bs grids seem to make it as such.
Stephen James
@sjames1958gm
Apr 08 2016 12:53
@jonah-butler What are the issues/
jonah-butler
@jonah-butler
Apr 08 2016 12:54
I did take a peek at his and noticed there were several different col-x-x classes used on one div.
kirbyedy
@kirbyedy
Apr 08 2016 12:54
@jonah-butler just make sure the sum of col is 12
so for example 3 -6 -3 will do the job
Stephen James
@sjames1958gm
Apr 08 2016 12:55
Without bootstrap stuff
.listStuff {
  width: 50%;
  margin: auto; 
}
jonah-butler
@jonah-butler
Apr 08 2016 12:57
@sjames1958gm you the real MVP today.
Thanks for that.
I know I need a deeper understanding of using margin and width in my css.
Stephen James
@sjames1958gm
Apr 08 2016 12:58
@jonah-butler You may want to investigate, some time, the info that @kirbyedy gave you as bootstrap is pretty popular
jonah-butler
@jonah-butler
Apr 08 2016 13:00

Yeah, I definitely will.
Maybe you could clarify.
The example uses:

<div class="col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">

Not really seeing how that adds up to 12.
I'm clearly missing something(simple I'm sure) here.
Stephen James
@sjames1958gm
Apr 08 2016 13:02
@jonah-butler The center letters are for different screen sizes. xs - extra small == 12, the next is small 10 + offset of 1 on the left (there is another on the right not listed == 12, the same for 8 + 2 * 2
random-x
@random-x
Apr 08 2016 13:07
I did my first vaguely-interesting thing in bootstrap last night and I was saying how much work it seemed like it was :S
a lot of manual re-checking of how things look at different sizes and such
jonah-butler
@jonah-butler
Apr 08 2016 13:09
@sjames1958gm Once again, thanks.
CamperBot
@camperbot
Apr 08 2016 13:09
jonah-butler sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 512 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
jonah-butler
@jonah-butler
Apr 08 2016 13:09
I will look into some more info about the bs grids later on.
Stephen James
@sjames1958gm
Apr 08 2016 13:10
@jonah-butler NP - glad to help
random-x
@random-x
Apr 08 2016 13:10
but I at least did figure out what "mobile first" really meant.
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:25
@random-x yes with container-fluid most of the things falls into place
Dranaxel
@Dranaxel
Apr 08 2016 13:35
Hello, can someone help me with the bootstrap scrollspy ?
http://codepen.io/Dranaxel/pen/jqBXWY It's almost working but i can't succeed to change the color of the active section :/
Please don't take a look to the color, I know it's awful ^^'
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:40
@Dranaxel I am not an expert in this but shouldn't you use javascript with it too ??
Natasha Nazari
@natashanazari
Apr 08 2016 13:40
Working on the portfolio project. I added a ripple animation, but for some reason, the position is off when it scales down to a smaller screensize. It should be in the center, behind my profile picture, like it is when viewed on a laptop. Also, I don’t understand why my text in the first section is sliding over into the second. I made sure everything was responsive. Help? https://codepen.io/natashagogo/full/BKJpJJ/
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:41
This message was deleted
@Dranaxel such as this ??
$('#myScrollspy').on('activate.bs.scrollspy', function () {
  // do something…
})
Dranaxel
@Dranaxel
Apr 08 2016 13:42
@Mr-Kumar-Abhishek Maybe I misunderstood the W3C docs, but it seems to me that you can use it without JS
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:43
@Dranaxel those are not W3C docs
@Dranaxel refer bootstrap docs http://getbootstrap.com/javascript/#scrollspy
Dranaxel
@Dranaxel
Apr 08 2016 13:44
Oh ok
Thanks, i'm going to take a look
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:44
@Dranaxel these are w3c docs https://www.w3.org/2012/10/webplatform.html.en
@Dranaxel which doesn't and shouldn't have bootstrap ;)
Dranaxel
@Dranaxel
Apr 08 2016 13:45
ok, sorry for the confusion ^^'
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:46
@Dranaxel no problem and your welcome
:smile:
@natashasgodwin Hmm.. Looking at it..
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 13:52

@natashasgodwin I see you have set it absolute positioning ,

.pulse1 {
    position: absolute;
    width: 18em;
....
}

However while doing this do remember that other elements may line up differently when they set up for adjusting in different screen, use , z index to stack things up or below the z axis with relative positioning .

@natashasgodwin This might help you https://developer.mozilla.org/en/docs/Web/CSS/z-index
Natasha Nazari
@natashanazari
Apr 08 2016 13:55
@Mr-Kumar-Abhishek Thank you!
CamperBot
@camperbot
Apr 08 2016 13:55
natashasgodwin sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:star: 305 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:03
@natashasgodwin also shouldn't you use percentages % instead em values for this ? Test them out i am not sure for this.
Natasha Nazari
@natashanazari
Apr 08 2016 14:06
@Mr-Kumar-Abhishek Why? I thought ems were more accurate? Not sure how to go about percentages for this, but I’ll try.
@Mr-Kumar-Abhishek Even with z-index, it’s not lining-up properly on smaller screens. It’s driving me nuts. 😅
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:07
@natashasgodwin yes I have checked it too.. hmm... use media queries to solve it ?
Natasha Nazari
@natashanazari
Apr 08 2016 14:10
@Mr-Kumar-Abhishek Okay, I’ll look into it. Thanks!
CamperBot
@camperbot
Apr 08 2016 14:10
natashasgodwin sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:warning: natashasgodwin already gave mr-kumar-abhishek points
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:13
@natashasgodwin try this:

.pulse1 {
    position: absolute;
    z-index: 2;
    width: 18em;
    height: 18em;
    margin-left: auto;
    margin-right: auto;
    margin-top: 13%;
    opacity: 0;
    border: .2em solid rgba(255,255,255,.1);
    top: 0; 
    left: 0; 
    bottom: 0; 
    right: 0;

    -webkit-animation: pulsejg1 4s linear infinite;
    -moz-animation: pulsejg1 4s linear infinite;
    animation: pulsejg1 4s linear infinite;
    -webkit-border-radius: 62em;
    -moz-border-radius: 62em;
    border-radius: 62em;
    -webkit-box-shadow: inset 0 0 .938em .938em rgba(0, 0, 0, .6);
    -moz-box-shadow: inset 0px 0px .938em .625em rgba(0, 0, 0, .6);
    box-shadow: inset 0px 0px .938em .625em rgba(0, 0, 0, .6);
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.pulse2 {
    position: absolute;
    z-index: 1;
    width: 16em;
    height: 16em;
    margin-left: auto;
    margin-right: auto;
    margin-top: 14%;
    top: 0; 
    left: 0; 
    bottom: 0; 
    right: 0;
    opacity: 0;
    border: 1px solid rgb(0, 0, 68, 102);

    -webkit-animation: pulsejg2 4s linear infinite;
    -moz-animation: pulsejg2 4s linear infinite;
    animation: pulsejg2 4s linear infinite;
    -webkit-border-radius: 62em;
    -moz-border-radius: 62em;
    border-radius: 62em;
    -webkit-box-shadow: inset 0 0 0.750em 0.313em rgba(255, 255, 255, .8);
    -moz-box-shadow: inset 0 0 0.750em 0.313em rgba(255, 255, 255, .8);
    box-shadow: inset 0px 0px 0.750em 0.313em rgba(255, 255, 255, .8);
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
@natashasgodwin although this might not be accurate enough with diffrent sizes, hmm... you have to use position: relative to achieve what you were looking for and add a z index over it
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:18
@natashasgodwin keep the two circles in same z index and relative positioning will help to make concentric circles and ripples
Natasha Nazari
@natashanazari
Apr 08 2016 14:21
@Mr-Kumar-Abhishek It’s better, but the circles are still not perfectly inline with the photo. When I switch the relative positioning, the circles move down, to the next container-fluid.
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:25
@natashasgodwin yes you have to reposition them in relative positioning. have a top margin to adjust if you are keeping in absolute also, it is just a better approach to use z-index with relative position to make concentric ripples . A little bit dabbling might help to solve it.
ehekatlOf
@ehekatlOf
Apr 08 2016 14:26
I might be super wrong
but you're trying to get the 2 ebbing animations to overlap with different radii correct?
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:27
@ehekatlOf yes
ehekatlOf
@ehekatlOf
Apr 08 2016 14:27
can't you just add top : 1 em to the smaller 16em animation?
.pulse2 {
    position: absolute;
    z-index: 2;
    width: 16em;
    height: 16em;
    margin-left: auto;
    margin-right: auto;
    margin-top: 15%;
    top: 1em; 
    left: 0; 
    bottom: 0; 
    right: 0;
    opacity: 0;
    border: 1px solid rgb(0, 0, 68, 102);
seems to have done it for me
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:28
@ehekatlOf oh yes , seems I was super wrong ;P
ehekatlOf
@ehekatlOf
Apr 08 2016 14:28
makes sense right
you're adding the delta radius of the larger and the smaller
to the positioning
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:29
@natashasgodwin refer what @ehekatlOf has suggested.
Natasha Nazari
@natashanazari
Apr 08 2016 14:30
@ehekatlOf YES! Thank you so much! Omg, I was about to lose my mind!!
CamperBot
@camperbot
Apr 08 2016 14:30
natashasgodwin sends brownie points to @ehekatlof :sparkles: :thumbsup: :sparkles:
:star: 247 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
ehekatlOf
@ehekatlOf
Apr 08 2016 14:30
lol all good
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:33
@ehekatlOf I should have figured this out sooner ..
ehekatlOf
@ehekatlOf
Apr 08 2016 14:33
hahaha
there's a lot going on
I just stumbled into it
Abhishek Kumar
@Mr-Kumar-Abhishek
Apr 08 2016 14:34
@ehekatlOf thanks for the help :)
CamperBot
@camperbot
Apr 08 2016 14:34
mr-kumar-abhishek sends brownie points to @ehekatlof :sparkles: :thumbsup: :sparkles:
:star: 248 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
ehekatlOf
@ehekatlOf
Apr 08 2016 14:34
np man
Islam Ibakaev
@dagman
Apr 08 2016 14:52
hey guys i got a problem with my calculator. When i evaluate expression by clicking = sign and then click on number button it continues result http://codepen.io/dagman/pen/NNXdxw?editors=0111
jinrawx
@jinrawx
Apr 08 2016 15:17
Hello peoples. I need some assistance with using jquery's mousewheel plugin to make a div scroll horizontally when a user scrolls their mouse over the div. This is what I got so far:
$("#flickrGallery").bind('mousewheel DOMMouseScroll', function(e) {
     // prevent regular event behavior(scrolling up/down)
      e.preventDefault();

     // store wheelDelta info into var. main idea is that it will be positive or negative
      var delta = e.wheelDelta || -e.detail || e.originalEvent.wheelDelta || -e.originalEvent.detail;
     // if  delta is positive, scroll right.  if delta is negative, scroll left.(something along those lines, not sure because I haven't got it to work)
     $(this).css({'top': $(this).position().top + (delta > 0 ? '+=40' : '-=40')});
   });
Rex Smith Jr.
@rsmith731
Apr 08 2016 15:34
hey does anyone know where i can go to learn how to pull down stuff from GIT and install node.js and ember.js?
Arpit Saxena
@arpit-saxena
Apr 08 2016 15:35
Do gitit and learnyounode @rsmith731
Rex Smith Jr.
@rsmith731
Apr 08 2016 15:48
@arpit-saxena thanks!
CamperBot
@camperbot
Apr 08 2016 15:48
rsmith731 sends brownie points to @arpit-saxena :sparkles: :thumbsup: :sparkles:
:star: 328 | @arpit-saxena | http://www.freecodecamp.com/arpit-saxena
Manoj Singh
@manojansh
Apr 08 2016 15:52
@manojansh
Hello, I need a quick little help please!
my css is working in chrome, but in Mozilla it is not loading.
Please help
anyone??
Stephen James
@sjames1958gm
Apr 08 2016 15:52
@dagman You need a variable that tells your code whether it is doing number input, when to reset number input, etc.
Rex Smith Jr.
@rsmith731
Apr 08 2016 15:53
@camperbot is amazing!
Manoj Singh
@manojansh
Apr 08 2016 15:55
someone please help
Bruce Young
@mutantspore
Apr 08 2016 15:58
@manojansh can we see?
Manoj Singh
@manojansh
Apr 08 2016 15:59
@mutantspore -- my CSS does not load in Mozilla but loads in Chrome
blob
for chrome--
blob
for mozilla
@mutantspore please help
Bruce Young
@mutantspore
Apr 08 2016 16:03
ok but that’s not enough info for me at least . you are showing that the api seems to work in one not the other
take 5 mins to put it in codepen so I can see the issues
Manoj Singh
@manojansh
Apr 08 2016 16:04
no no @mutantspore , in chrome my data is in center of page, while in mozilla it is in the default locaion i.e. top left
Stephen James
@sjames1958gm
Apr 08 2016 16:04
@manojansh Any errors in devtools - check the network tab to see if there are errors on reload - check the files to see if it is loaded.
Manoj Singh
@manojansh
Apr 08 2016 16:06
blob
@sjames1958gm
Stephen James
@sjames1958gm
Apr 08 2016 16:07
@manojansh Is your CSS in a separate file from html and js?
Bruce Young
@mutantspore
Apr 08 2016 16:07
@manojansh is that saying your bootstrap is not loading?
Stephen James
@sjames1958gm
Apr 08 2016 16:07
@mutantspore I think it is saying it is cached
Manoj Singh
@manojansh
Apr 08 2016 16:07
@sjames1958gm yes, it is in different file
Stephen James
@sjames1958gm
Apr 08 2016 16:07
304 Not Modified
Manoj Singh
@manojansh
Apr 08 2016 16:08
@mutantspore -- the external css styling I am applying, that is not loading
@sjames1958gm what to do?
Stephen James
@sjames1958gm
Apr 08 2016 16:08
@manojansh -- your own CSS file or a library?
Manoj Singh
@manojansh
Apr 08 2016 16:09
@sjames1958gm My own css file, background color, center align all that
Bruce Young
@mutantspore
Apr 08 2016 16:09
well you’ll have to recheck the exact file path. one browser may be more forgiving of a mistake than the other
Manoj Singh
@manojansh
Apr 08 2016 16:09
I heard that there is some problem with mozilla I am not sure though
Stephen James
@sjames1958gm
Apr 08 2016 16:09
@sjames1958gm I don't know the devtools for mozilla enough to see if it loaded it or not.
Manoj Singh
@manojansh
Apr 08 2016 16:10
in Internet Explorer it is working fine
Bruce Young
@mutantspore
Apr 08 2016 16:14
@manojansh you shouldn’t really do this C:\Users\manoj\Desktop\weatherTrial\weather.css just make the path relative to the html file. if it’s in the same folder you just need the file name weather.css
Manoj Singh
@manojansh
Apr 08 2016 16:16
ok Let me try @mutantspore
@mutantspore hey you are awesome
Bruce Young
@mutantspore
Apr 08 2016 16:17
lol :)
Manoj Singh
@manojansh
Apr 08 2016 16:17
thank you soo much @mutantspore
CamperBot
@camperbot
Apr 08 2016 16:17
manojansh sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1373 | @mutantspore | http://www.freecodecamp.com/mutantspore
Manoj Singh
@manojansh
Apr 08 2016 16:17
but I dont understand, even if I am giving absolute address why i aint loading?? @mutantspore
it*
Bruce Young
@mutantspore
Apr 08 2016 16:18
no idea … as you can see it’s browser specific
Manoj Singh
@manojansh
Apr 08 2016 16:18
oh ok, thanks for the help :) @mutantspore
CamperBot
@camperbot
Apr 08 2016 16:18
manojansh sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: manojansh already gave mutantspore points
ehekatlOf
@ehekatlOf
Apr 08 2016 16:26
is there a good resource to learn angular?
codeacademy has most of the course behind a paywall
Stephen James
@sjames1958gm
Apr 08 2016 16:33
udemy has courses - pretty inexpensive
ehekatlOf
@ehekatlOf
Apr 08 2016 16:35
oh I've never used this site
thanks @sjames1958gm
CamperBot
@camperbot
Apr 08 2016 16:35
ehekatlof sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 517 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Apr 08 2016 16:35
seems to be kind of a aggregation of other training sites - check the reviews before making any purchase
ehekatlOf
@ehekatlOf
Apr 08 2016 16:37
yeah
Brian
@sludge256
Apr 08 2016 16:44
CodeSchool has some Angular 1.x material. Some of it requires a subscription though.
Jeremie Wrady
@wradyleadsolutions
Apr 08 2016 16:47
Hello everyone. I am brand new to coding and GitHub, all this cool stuff. I was wondering if someone could assist we and tell me why I cant seem to get past the repository tort?
ehekatlOf
@ehekatlOf
Apr 08 2016 16:55
hey thanks @sludge256
CamperBot
@camperbot
Apr 08 2016 16:55
ehekatlof sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 2134 | @sludge256 | http://www.freecodecamp.com/sludge256
Brian
@sludge256
Apr 08 2016 16:56
@wradyleadsolutions Git-it?
Gregory Buhler
@Gregory-Buhler
Apr 08 2016 16:56
@wradyleadsolutions this tutorial helped me with GitHub and git: https://www.youtube.com/watch?v=1h9_cB9mPT8&list=PLqGj3iMvMa4LFz8DZ0t-89twnelpT4Ilw
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 16:57
hello, fellow campers
I'd like to request some help, if possible, with consuming OpenWeatherMap API
Bruce Young
@mutantspore
Apr 08 2016 16:58
@gcantacini ask away
Jeremie Wrady
@wradyleadsolutions
Apr 08 2016 17:00
Thank you so much for that!
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 17:01

@mutantspore thanks

I'm currently having troubles on consuming this API...
it's not the same thing as consuming an API in Mashape, because it requires that you use a key of theirs...
I've already signed up at their website and all, I've got the key and I can make it work if I just get the address and make the request passing my key via parameters

but I can't retrieve anything on code... I'm using the AJAX method to retrieve the JSON object from the website, but it's not working

Bruce Young
@mutantspore
Apr 08 2016 17:02
do you have this as a pen that we can see?
@gcantacini
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 17:03

@mutantspore, not yet... I'm trying to develop in my own machine

I'll upload the code to CodePen now, just a sec

Bruce Young
@mutantspore
Apr 08 2016 17:04
@gcantacini ok I do that too.
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 17:06

@mutantspore , here is the Pen link
http://codepen.io/gcantacini/pen/aNEREK

I didn't put any visual elements yet, I'm just working on making this API consumption work

so, there's only jQuery code there
Brian
@BrianCodes33
Apr 08 2016 17:09
any wordpress experts out there willing to help me?
Bruce Young
@mutantspore
Apr 08 2016 17:10
@gcantacini JSON.stringify(response));
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 17:10
@mutantspore , will try that
@mutantspore , thanks a ton!
CamperBot
@camperbot
Apr 08 2016 17:10
gcantacini sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1374 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Apr 08 2016 17:12
@gcantacini you don’t need to do that fo rteh actual exercise. just read the object . you can see it in the console using console.log(response);
or more specifically something like console.log(response.main.temp);
which is the temperature in Kelvin
Glauber Cantacini Romano
@gcantacini
Apr 08 2016 17:15
@mutantspore , got it
@mutantspore , thanks a lot! that really did help me!
CamperBot
@camperbot
Apr 08 2016 17:19
gcantacini sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: gcantacini already gave mutantspore points
Coryphaeus
@cvdeby
Apr 08 2016 17:38
I have problems with $.ajax. It's double encoding url string. How can I turn off url encoding in ajax request? &query=searchstring|param=1 returns &query=searchstring%257Cparam=1.
Arminas
@ArminasBek
Apr 08 2016 17:46
Hello can someone help me with this waypoint? https://www.freecodecamp.com/challenges/iterate-through-an-array-with-a-for-loop how it possible toset value total of 20?
Stephen James
@sjames1958gm
Apr 08 2016 17:48
@ArminasBek Show us your code. [2, 3, 4, 5, 6] - the sum is 20
Arminas
@ArminasBek
Apr 08 2016 17:49

‘’'
var total = 0;
for (var i=0; i < myArr.length; i++) {
total = total[i];

}
‘''

Stephen James
@sjames1958gm
Apr 08 2016 17:50
@ArminasBek this line total = total[i]; is not correct 1) it assigns doesn't add to total 2) doesn't access the array myArr[i]
kirbyedy
@kirbyedy
Apr 08 2016 17:50
you might missing an addition sign
Reggie Washington
@Rwash26
Apr 08 2016 17:50
Can anyone tell me why my carousel isn't working? https://codepen.io/rwashington21/full/jqagwN/
Stephen James
@sjames1958gm
Apr 08 2016 17:51
@ArminasBek Take another look at the sample code above your code for that challenge.
Arminas
@ArminasBek
Apr 08 2016 17:51
hmm @sjames1958gm thank you i will try now
CamperBot
@camperbot
Apr 08 2016 17:51
arminasbek sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 518 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Arminas
@ArminasBek
Apr 08 2016 17:52
@sjames1958gm thank you! done it, that was my stupid mistake ;))))
CamperBot
@camperbot
Apr 08 2016 17:52
arminasbek sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: arminasbek already gave sjames1958gm points
Stephen James
@sjames1958gm
Apr 08 2016 17:54
@ArminasBek Fundamental rule of programming. Always assume it is your own stupid mistake. That's what I program by.
kirbyedy
@kirbyedy
Apr 08 2016 17:55
@Rwash26 not sure what this line does $("#carousel").carousel();
but it surely reports an error in your code
Stephen James
@sjames1958gm
Apr 08 2016 17:56
@Rwash26 Do you need to include another JQuery library jqueryUI perhaps.
Randy Goldsmith
@Dueldrawer8
Apr 08 2016 18:00
shouldnt this be retreiving whatever i type into the textbox whenever I press enter. I do a console.log and nothing appears in console.
http://codepen.io/duel_drawer8/pen/wGpmGe?editors=1111
hmm..anyone?
Reggie Washington
@Rwash26
Apr 08 2016 18:06
@sjames1958gm what JQuery library should I use? I have tried a few
kirbyedy
@kirbyedy
Apr 08 2016 18:06
@Dueldrawer8 not sure what does this mean format=jsonfm
Stephen James
@sjames1958gm
Apr 08 2016 18:06
@Dueldrawer8 you have type=text in handler and type=textbox in your element
Randy Goldsmith
@Dueldrawer8
Apr 08 2016 18:07
@kirbyedy just makes it easier to "debug" the website said and spaces out all the data making it easier to read than regular json
@sjames1958gm okay ill try that
kirbyedy
@kirbyedy
Apr 08 2016 18:07
ah ok
codercooooder
@codercooooder
Apr 08 2016 18:08
guys is there any way to search the chat room history to find your old posts?
Stephen James
@sjames1958gm
Apr 08 2016 18:08
@Rwash26 I would assume jqueryUI but not sure where you got that code.
Reggie Washington
@Rwash26
Apr 08 2016 18:10
Im using 1.11.4 and still the same issue https://codepen.io/rwashington21/full/jqagwN/
Randy Goldsmith
@Dueldrawer8
Apr 08 2016 18:12
@sjames1958gm thanks
CamperBot
@camperbot
Apr 08 2016 18:12
dueldrawer8 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 520 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Apr 08 2016 18:12
@Dueldrawer8 :+1:
codercooooder
@codercooooder
Apr 08 2016 18:20
nevermind I figured out - there are archives...
Erik Villoria
@kire73
Apr 08 2016 18:26

almost done with my quote machine:
http://codepen.io/evilloria/pen/jqaZEV?editors=1111

Can't figure out why I have to open the twitter link in a new tab

Also doesn't look like it's generating here but when I run it in my editor window its fine
Erik Villoria
@kire73
Apr 08 2016 18:31
This message was deleted
Nickolas Gettel
@nickolaskg
Apr 08 2016 18:35
Hey guys, i'm going through my older ziplines and noticed the weather api zipline isnt working like it USED to work. Now instead of displaying the city, state(country code), it just displays undefined for all of them. can someone take a look ? http://codepen.io/nickolaskg/pen/GpawKK?editors=1010
Bruce Young
@mutantspore
Apr 08 2016 18:38
@nickolaskg it’s ok for me. though you have a basic flaw in the way you have coded it. I live in Hudson FL as you know… it’s showing me the weather for Hudson NY.. about 40F difference right now!! lol . Grab the lat and lon and use that instead. The OWM api use dto work with out a key… it’s needed now. I see you have one.
Nickolas Gettel
@nickolaskg
Apr 08 2016 18:39
lol oh wow thats a bit of a bug... So its not showing up undefined? Maybe its just my browser
Bruce Young
@mutantspore
Apr 08 2016 18:39
Screen Shot 2016-04-08 at 2.39.24 PM.png
Marc
@wumpafruits
Apr 08 2016 18:39
$(document).ready(function(){
$("#newQuote").click(function(){
 $("#quotehere").append(randomNumber());
});
});

function randomNumber(num){
return Math.floor(Math.random() * 11);
}
The result is the randomNumber..then the next randomNumber sits right next to it. Can i use remove to remove randomNumbe rw/ jquery?
Bruce Young
@mutantspore
Apr 08 2016 18:40
@nickolaskg Safari/Mac
Nickolas Gettel
@nickolaskg
Apr 08 2016 18:40
Yeah, I just tried it on microsoft edge and it works. So must be a problem with chrome.
Bruce Young
@mutantspore
Apr 08 2016 18:40
@nickolaskg fine on Chrome/Mac
Coy Sanders
@coymeetsworld
Apr 08 2016 18:40
@wumpafruits the reason is because you're using append
Bruce Young
@mutantspore
Apr 08 2016 18:41
perhaps you have some extension or something in your chrome
Coy Sanders
@coymeetsworld
Apr 08 2016 18:41
append adds to the dom
Marc
@wumpafruits
Apr 08 2016 18:41
oh i suppose ill use another way to display the number
Nickolas Gettel
@nickolaskg
Apr 08 2016 18:41
@mutantspore Yeah thanks, i'm pretty sure its an ad blocker causing the problem
CamperBot
@camperbot
Apr 08 2016 18:41
nickolaskg sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1375 | @mutantspore | http://www.freecodecamp.com/mutantspore
Stephen James
@sjames1958gm
Apr 08 2016 18:42
@wumpafruits replace with text()
Marc
@wumpafruits
Apr 08 2016 18:43
@coymeetsworld @sjames1958gm thanks!
CamperBot
@camperbot
Apr 08 2016 18:43
wumpafruits sends brownie points to @coymeetsworld and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 492 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
:star: 523 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Erik Villoria
@kire73
Apr 08 2016 18:44
OK so theres something stopping my script from generating new quotes once the twitter link is clicked, so only the background changes, you'll have to follow the link in order to see it work at all: http://codepen.io/evilloria/full/jqaZEV/
here is my script:
$("#getQuote").on("click", function() {
    var res;
    var str = [];
    var auth;
    var long = [];
    var short = ["", ];
    var count = next();
    $(".background").css("background-color", change[next()]);
    $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=20&callback=", function(json) {
      str = (json[count].content);
      auth = (json[count].title);
      str = strip(str);
      auth = strip(auth);
      res = (str + "<p>— " + auth + "</p>");
      $("#message").html(str);
      $(".auth").html("<p>— " + auth);
      if (res.length < 140) {
        short = strip(res);
        $("#share").attr('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + short);
      }
      if (res.length > 140 || res.length == 140) {
        // console.log(res);
        str.split("");
        for (var i = 0; i < 100; i++) {
          long[i] = res[i];
        }
        long = long.join("");
        $("#share").attr('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + long + "... -" + auth);
      }
    });
  });
});
the doer
@ewathedoer
Apr 08 2016 18:44
I am trying to debug the buttons styles on touch devices, how to make the #random button come back to original style after being tapped? http://codepen.io/thedoer/pen/EKbrpO
anddash
@anddash
Apr 08 2016 18:53
Hi. I am trying to do the Portfolio page and having trouble knowing how to start. Am I meant to find the code for a scrolling page then import it into codepen? I found this: http://startbootstrap.com/template-overviews/scrolling-nav/ in github, but don't know if I am on the right track or not. If so can anyone tell me how to move the code from github to codepen. Or am I way off track!
Nickolas Gettel
@nickolaskg
Apr 08 2016 18:54
@anddash You can start wherever you'd like. The example doesnt have any fancy code for a scrolling-nav(that I remember). I believe its just CSS div background properties
negyvenketto
@negyvenketto
Apr 08 2016 18:58
@kire73 i'm not sure i'll be able to help, but i'm looking at it
John T. Bull
@jbull328
Apr 08 2016 18:59
@ewathedoer I looked at it on my iphone and it looks pretty good. Are you talking about the choose for me button staying highlighted?
the doer
@ewathedoer
Apr 08 2016 18:59
yes
the same is with arrow top in footer
@jbull328
John T. Bull
@jbull328
Apr 08 2016 19:01
@ewathedoer found this link twbs/bootstrap#10657 I'll keep googleing maybe there is an answer
Susan Harrison
@stharrison1
Apr 08 2016 19:02
I was wondering if someone could help be figure out why everytime I click home I get duplicates of the the project?
https://sharrison-portfolio.herokuapp.com/
the doer
@ewathedoer
Apr 08 2016 19:03
thanks @jbull328 I will need to dig deeper
CamperBot
@camperbot
Apr 08 2016 19:03
ewathedoer sends brownie points to @jbull328 :sparkles: :thumbsup: :sparkles:
:star: 352 | @jbull328 | http://www.freecodecamp.com/jbull328
@ewathedoer Thanks, You'll get it.
CamperBot
@camperbot
Apr 08 2016 19:04
jbull328 sends brownie points to @ewathedoer :sparkles: :thumbsup: :sparkles:
:star: 282 | @ewathedoer | http://www.freecodecamp.com/ewathedoer
anddash
@anddash
Apr 08 2016 19:05
@nickolaskg well thanks I'll give it a go then. I've spent the last 24 hours researching scrolling navs!
negyvenketto
@negyvenketto
Apr 08 2016 19:06
@kire73 i don't yet know where the problem is, but for me the twitter button doesn't even work if i click it, i need to ctrl+click it. you might want to fix it so it opens in a new window.
Brian
@BrianCodes33
Apr 08 2016 19:09
do i need permission to use bootstrap pre-built templates?
negyvenketto
@negyvenketto
Apr 08 2016 19:16
@kire73 and for some reason adding target="_blank" in your link fixes the problem
i think the reason might be that codepen won't let you open links in the same tab, so when you try it something breaks...
Stephen James
@sjames1958gm
Apr 08 2016 19:20
@BrianCodes33 As far as I know no.
John T. Bull
@jbull328
Apr 08 2016 19:29
Hello friends, I'm a bit stuck on my Twitch app. I'm so close but having trouble conseptualizing where to start next. I have duplicates, whether the streamer is inline or not they show. It's probably something simple but I can only think of refactoring. I could use a second pair of eyes if anyone is interested. http://codepen.io/jbull328/pen/EKvxRX
Bruce Young
@mutantspore
Apr 08 2016 19:58
@jbull328 I’ve not seen anyone try to send all the users at once to the api. from your console.log of the returned data, it seems to have only returned the last one. I made an api call for each of the twitch users. you probably will have to make a second api call to get all the info needed for those offline.
@jbull328 if you end up calling the api for each of the users, don’t use a for loop as that will not work correctly with the asynchronous api calls. I used a .forEach to “loop” though them.
Jeff
@adzam5
Apr 08 2016 20:03
Anyone familiar with materialize css?
Bruce Young
@mutantspore
Apr 08 2016 20:04
@adzam5 a little, I used it for my Tic-tac-toe awhile ago and I’m revisiting it again now to clean it up to submit it. It’s hard to find actual details
Jeff
@adzam5
Apr 08 2016 20:14
@mutantspore I'm 90% done with a site I am working on and when looking for checkboxes that were "prettier" than bootstrap I came across materialize. I ended up incorporating the materialize checkboxes and radio buttons into my bootstrap site. I was just wondering if it was worth it to just fully switch the site over to materialize.
Bruce Young
@mutantspore
Apr 08 2016 20:21
I like it. I think it’s at least worth doing a project or two with it .
Drew Stew
@drewbstew
Apr 08 2016 20:33
could anyone help with a JS debug? I'm working on the weather project and I'm having trouble concatenating a URL for $.ajax http://codepen.io/drewbstew/pen/WwdORM?editors=1111
Andrew
@andrewpalfenier
Apr 08 2016 20:34

I'm having trouble with a $.fadeOut()'s callback function not waiting until it's done fading out. It works elsewhere in the same code, just not for this one, for some reason.

$('#condition, #weather-icon, #tempDisplay').fadeOut("fast", update(data)).fadeIn("fast");

Drew Stew
@drewbstew
Apr 08 2016 20:34
actually, it's not throwing an error in console for some reason, but it happens on my github pages: https://drewbstew.github.io/local_weather/
Andrew
@andrewpalfenier
Apr 08 2016 20:35
negyvenketto
@negyvenketto
Apr 08 2016 20:35
@drewbstew i'm looking at it
Mark Little
@MarkBLittle
Apr 08 2016 20:36
@drewbstew try putting everything inside your if statement
Bruce Young
@mutantspore
Apr 08 2016 20:36
@drewbstew a few things… the key needs APPID=
also as the gelocate is ascrychonous you’ll need to put the setAPIURL in it or call it from it.
@drewbstew also LAT and LON are numbers and can stay numbers… no need to mak ethem strings
Mark Little
@MarkBLittle
Apr 08 2016 20:37
@mutantspore He's using forecast.io rather than OWA. He may not have that all written out correctly - I haven't looked at their docs
Bruce Young
@mutantspore
Apr 08 2016 20:38
lol ok
missed that sorry
Mark Little
@MarkBLittle
Apr 08 2016 20:38
He may have that all written out correctly*
Drew Stew
@drewbstew
Apr 08 2016 20:38
hmm, i think he documentation for forecast.io has the appid as I put it; after forecast, before the coords, no appid= necessary
Bruce Young
@mutantspore
Apr 08 2016 20:39
regardless the call to teh weather must be made from inside the geolocate
Drew Stew
@drewbstew
Apr 08 2016 20:39
as for LAT and LON, don't I need to make them strings before I concatenate them with a string (the rest of the URL)?
ok, I'll give that a shot
Mark Little
@MarkBLittle
Apr 08 2016 20:39
The issue is most likely that the if statement determinining whether the browser supports geolocation (or the user allows it) is separated from the rest of the code. I'd try throwing the rest of the code inside it.
Drew Stew
@drewbstew
Apr 08 2016 20:41
great! calling setAPIURL within that statement seems to return the variable
thanks @MarkBLittle @mutantspore
CamperBot
@camperbot
Apr 08 2016 20:41
drewbstew sends brownie points to @markblittle and @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1376 | @mutantspore | http://www.freecodecamp.com/mutantspore
:star: 278 | @markblittle | http://www.freecodecamp.com/markblittle
Andrew
@andrewpalfenier
Apr 08 2016 20:46
never mind, I figured it out.
Bruce Young
@mutantspore
Apr 08 2016 20:47
@andrewpalfenier don’t use the city name to get the weather. I live in Hudson Florida… it’s giving me the weather for Hudson New York!!! about 40F difference in temp
Andrew
@andrewpalfenier
Apr 08 2016 20:47
Good point! I'm planning to use latitude and longitude
Bruce Young
@mutantspore
Apr 08 2016 20:47
@andrewpalfenier us the lat and lon
ok
Andrew
@andrewpalfenier
Apr 08 2016 20:47
I've found the api also gives some weird results for zip codes
Bruce Young
@mutantspore
Apr 08 2016 20:48
@andrewpalfenier OWM API isn’t the most accurate, the Forecast.io one is far better but OWM is easy for this project
Mark Little
@MarkBLittle
Apr 08 2016 20:49
zip codes should be closer than city name for accuracy, but could still be +-5 or so degrees off
Erik Villoria
@kire73
Apr 08 2016 20:50
@negyvenketto thank you! i seem to remember hearing something about that with codepen. i add it to the anchor element right?
CamperBot
@camperbot
Apr 08 2016 20:50
kire73 sends brownie points to @negyvenketto :sparkles: :thumbsup: :sparkles:
:star: 341 | @negyvenketto | http://www.freecodecamp.com/negyvenketto
Pawan
@pawan92
Apr 08 2016 20:51
hey someone i asked this before and ive been trying to figure this out but cant get my results to float to left and also how can i search again after searching for it once?
negyvenketto
@negyvenketto
Apr 08 2016 20:53
@kire73 you add it as an anchor in the html section
John T. Bull
@jbull328
Apr 08 2016 20:53
@mutantspore Thanks, that's good advise.
CamperBot
@camperbot
Apr 08 2016 20:53
jbull328 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1377 | @mutantspore | http://www.freecodecamp.com/mutantspore
Mark Little
@MarkBLittle
Apr 08 2016 20:56
@pawan92 add text-align: left; to your ol
Pawan
@pawan92
Apr 08 2016 20:57
@MarkBLittle ohh thanks! :smile: any idea on searching again?
CamperBot
@camperbot
Apr 08 2016 20:57
pawan92 sends brownie points to @markblittle :sparkles: :thumbsup: :sparkles:
:star: 279 | @markblittle | http://www.freecodecamp.com/markblittle
Amit
@amit-s
Apr 08 2016 20:58
@pawan92 it IS searching again but the old results aren't clearing. scroll down
Pawan
@pawan92
Apr 08 2016 20:59
@amit-s ohh your right!
Mark Little
@MarkBLittle
Apr 08 2016 21:01
Yeah, you just have to clear out the array your results are in. arrayName.length = 0; should do it.
Pawan
@pawan92
Apr 08 2016 21:15
thanks @MarkBLittle
CamperBot
@camperbot
Apr 08 2016 21:15
pawan92 sends brownie points to @markblittle :sparkles: :thumbsup: :sparkles:
:warning: pawan92 already gave markblittle points
Federico Dente
@fez994
Apr 08 2016 21:29
Hi guys, i can't figure out how to change the background color based on the Weather condiction, can someone give me hint?
Bruce Young
@mutantspore
Apr 08 2016 21:29
@fez994 what are you using as the api?
Federico Dente
@fez994
Apr 08 2016 21:29
@mutantspore Yes i'm using the Open weather API
Is all working, it getting the data, but i don't understand how to change the background color
Mark Little
@MarkBLittle
Apr 08 2016 21:30
@fez994 Use a switch statement. In each case, change $("body").css("background", "whatever"); in your jQuery
Bruce Young
@mutantspore
Apr 08 2016 21:30
@fez994 http://openweathermap.org/weather-conditions
that has the condition icons and codes. you can use that to change css properties in your JS (or jQuery)
Federico Dente
@fez994
Apr 08 2016 21:31
i tryed this logic: if (weather === raining) then -> $('body').css('backgrond', " " );
Mark Little
@MarkBLittle
Apr 08 2016 21:31
Link to your pen?
Federico Dente
@fez994
Apr 08 2016 21:31
@MarkBLittle Thanks that is exactly what i was lookin for
CamperBot
@camperbot
Apr 08 2016 21:31
fez994 sends brownie points to @markblittle :sparkles: :thumbsup: :sparkles:
:star: 280 | @markblittle | http://www.freecodecamp.com/markblittle
Federico Dente
@fez994
Apr 08 2016 21:31
@MarkBLittle I'm using github pages, no codepen
Mark Little
@MarkBLittle
Apr 08 2016 21:32
Ah, okay. @mutantspore sent a link that should help you a whole lot too.
Bruce Young
@mutantspore
Apr 08 2016 21:35
@fez994 what I did was….
I set up an array of objects and used the weather icon code to return the URL of the background image I needed. That way there is no switch, loop, if’s etc
Federico Dente
@fez994
Apr 08 2016 21:36
@mutantspore The only problem i had is to figure out the various weather condiction, i checked on the Open weather API but could'nt find anything useful, thanks to @MarkBLittle now i know exactly how to do it
CamperBot
@camperbot
Apr 08 2016 21:36
fez994 sends brownie points to @mutantspore and @markblittle :sparkles: :thumbsup: :sparkles:
:warning: fez994 already gave markblittle points
:star: 1378 | @mutantspore | http://www.freecodecamp.com/mutantspore
Federico Dente
@fez994
Apr 08 2016 21:38
Something like this should work if (id >= 200 & id < 600)
Bruce Young
@mutantspore
Apr 08 2016 21:38
@fez994 yes if you are careful
Coryphaeus
@cvdeby
Apr 08 2016 21:39
Does somebody know, how could I solve such a problem, $.ajax encodes url twice, so, If I put | into the url, I got %257c. Why it happens and how could I turn off url encoding?
Hyun C Lee
@nanhyunchul
Apr 08 2016 21:47
hi, I am currently stuck on Chunky Monkey algorithm problem and I've been looking through the wiki page on the github
I've used all the suggested methods, like .splice and .push
but it seems that the for loop stops only after one iteration and would not go forward.
how an I upload a snippet for a help?
Bruce Young
@mutantspore
Apr 08 2016 21:49
help format
CamperBot
@camperbot
Apr 08 2016 21:49

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Bruce Young
@mutantspore
Apr 08 2016 21:50
@nanhyunchul I used a while loop
Hyun C Lee
@nanhyunchul
Apr 08 2016 21:50
```js
hmm
function chunkArrayInGroups(arr, size) {
  // Break it up.
  var myArray = [];
  for (var i = 0; i < arr.length; i += size) {
    myArray.push(arr.splice(i, i + size));
    console.log(myArray);
  }
  return myArray;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);
@mutantspore this is my code. It doesn't seem to register (i += size) statement
Bruce Young
@mutantspore
Apr 08 2016 21:57
@nanhyunchul
The splice() method changes the content of an array by removing existing elements and/or adding new elements.
@nanhyunchul so arr is getting smaller
Hyun C Lee
@nanhyunchul
Apr 08 2016 21:58
@mutantspore aha...so the size of an array would be decreased by the size that I input
Bruce Young
@mutantspore
Apr 08 2016 21:58
and hopefully that pushes to myArray
abtak mustapha
@mustapha88
Apr 08 2016 21:59
hello
everybody
Hyun C Lee
@nanhyunchul
Apr 08 2016 21:59
@mutantspore so should I just leave i set to 0, in order to push another batch of array into myArray since what was arr2 is now arr[0]
Federico Dente
@fez994
Apr 08 2016 21:59

Well i tryed but is not working

function changeBg() {

if (id >= 200 & id < 600) {
$('body').css('background', 'url: ("http://i.imgur.com/u9Mcd1P.jpg")');

} else if (id >= 600 & id < 700) {
$('body').css('background', 'url : ("../images/snow.jpg")');

} else if (id > 700 & id < 800) {
$('body').css('background', 'url : ("../images/fog.jpg")');

} else if (id > 800 & id < 900) {
('body').css('background', 'url : ("../images/cloudy.jpg")');

} else if (id === 800) {
('body').css('background', 'url : ("../images/sunny.jpg")');
}

}; // End function

changeBg();

Bruce Young
@mutantspore
Apr 08 2016 21:59
@nanhyunchul yes
Federico Dente
@fez994
Apr 08 2016 22:00
I have a folder with all images, i tryed to link them first , but it wasn't working, so i tryed again with imgurl, but not working either
abtak mustapha
@mustapha88
Apr 08 2016 22:00
i just begin weather app use javascript and i have probleme with excution this line <<var latlng = new google.maps.LatLng(lat, lng);>>
Bruce Young
@mutantspore
Apr 08 2016 22:01
@fez994 ok firstly stuff from Imgur wil fail so try http://postimage.org instead. Also all the others are local files
abtak mustapha
@mustapha88
Apr 08 2016 22:01
some one help??
Federico Dente
@fez994
Apr 08 2016 22:01
@mustapha88 I'm not using codepen, so it will not fail
Hyun C Lee
@nanhyunchul
Apr 08 2016 22:01
@mutantspore then would it still be ok to use for loop or while loop? since i would always be smaller than arr.length. wouldn't it go though an infinite loop? or does it stop if there's no items in arr?
Bruce Young
@mutantspore
Apr 08 2016 22:01
@fez994 also it’s && not &
@nanhyunchul I used while (arr.length > 0 ) {
Federico Dente
@fez994
Apr 08 2016 22:03
@mustapha88 changed but not working
Hyun C Lee
@nanhyunchul
Apr 08 2016 22:03
@mutantspore oh...i get it now....Thanks a lot!
Bruce Young
@mutantspore
Apr 08 2016 22:04
@fez994 using Imgur as a “server” is against their terms of use and most campers end up with missing images
abtak mustapha
@mustapha88
Apr 08 2016 22:04
@fez994 ,,,?? you mean that yu test the line in your browser
Federico Dente
@fez994
Apr 08 2016 22:04
@mustapha88 Again, i'm testing on my browser I'M NOT using codepen
Just Sublime Text
abtak mustapha
@mustapha88
Apr 08 2016 22:05
@fez994 ah ok
Federico Dente
@fez994
Apr 08 2016 22:05
I don't like Codepen
Bruce Young
@mutantspore
Apr 08 2016 22:05
@fez994 you noiced my comment about you having & instead of && in your if logic?
abtak mustapha
@mustapha88
Apr 08 2016 22:06
ya butit's required for dev our app in freecodecamp?,
Federico Dente
@fez994
Apr 08 2016 22:06
@mustapha88 Yes, i fixed but is not working
@mustapha88 I'm using GithubPages for the project, and there is a link for see the repository with all the code, so i think it will be fine
Bruce Young
@mutantspore
Apr 08 2016 22:07
@mustapha88 many people develop locally and just put it on codepen when they finish. the real issue is that your code is available for FCC to review it somewhere public,
Federico Dente
@fez994
Apr 08 2016 22:08
Just used something like <h2>Would you like to see the source code? Click <a href ="#githubrepo"> Here </a> </h2>
abtak mustapha
@mustapha88
Apr 08 2016 22:08
@fez994 ok i try a lot format but until now nothing work
Bruce Young
@mutantspore
Apr 08 2016 22:09
@fez994 this is of course where using Codepen is a bonus. It’s hard to get help. your issue may be not actually in the code you are posting. for example… do you have jQuery loaded?
Federico Dente
@fez994
Apr 08 2016 22:09
@mustapha88 I fixed the code with the double && and is not working. Btw the api is getting the ID correctly because if i use console.log(id); is showing the id of 500 (Wich is rain)
Yes jquery is perfectly working ( <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>)
As you can see here http://i.imgur.com/DJhXHK2.png The data are showing correctly , the only problem is with the background image
Bruce Young
@mutantspore
Apr 08 2016 22:11
from your pasted code, several of the lines are missing $ on teh jQuery bits
Federico Dente
@fez994
Apr 08 2016 22:12
@mutantspore Yes you are right, i fixed that too now, but is still not working
abtak mustapha
@mustapha88
Apr 08 2016 22:13
@fez994 now i'm confused to change to jquery because i fix alot in my code java script
Bruce Young
@mutantspore
Apr 08 2016 22:14
so have you checked if it’s working as far as the logic by putting in a console.log or altert in the reult of the if statement that works for 500?
Federico Dente
@fez994
Apr 08 2016 22:15
I just checked if is taking the correct id from the API (It's working, because the 500 id means light rain)
Bruce Young
@mutantspore
Apr 08 2016 22:15
@fez994 if that works then it’s a problem with the jquery bit . as I said don’t use imgur based images
yes but does it “fall” into teh right if logic
see this is painful.. you really need to make a quick pen
Federico Dente
@fez994
Apr 08 2016 22:16
@mutantspore Again, is not a problem with imgurl because if i go like this ../images/rain.jpg is not working either
I'll just put everything in a pen and send it
Bruce Young
@mutantspore
Apr 08 2016 22:16
ok @fez994 that wil help a lot ..
Federico Dente
@fez994
Apr 08 2016 22:17
The fonts are not working of course, because alot of the files are on a local folder
Bruce Young
@mutantspore
Apr 08 2016 22:19
@fez994 ok for a start, the call to the function changeBg(); must be in the getJSON with teh rest of your display code as it’s asynchronous
@fez994 id won’t have a value where it is
@fez994 and unless you make it global or pass it it still won’t know what it is
Federico Dente
@fez994
Apr 08 2016 22:21
@mutantspore I don't understand, it's inside the getJSON
Why shouldn't be? I mean if you see i closed the getJSON after the changeBg();
Bruce Young
@mutantspore
Apr 08 2016 22:23
@fez994 ok it may be .. just pressed “tidy” button to see it better
Jean Louis Salbego
@jlouiss
Apr 08 2016 22:24
var someFunction = function(arg) {
  // arg is an array
  var myArg = arg.splice(0);
  var myArr = functionReturningAnArray(myArg);
  var myOtherArr = myArr.map(function(elem) {
    return someOtherFunction(myArg.splice(0), elem);
  });
};
the problem is that someOtherFunction works only the first time, then when it is called it passes myArg as undefined, why?
help me please T_T
Federico Dente
@fez994
Apr 08 2016 22:25
@mutantspore I feel dumb, still not getting it http://i.imgur.com/lp5qnQ9.png the }); are closing the JSON call
Bruce Young
@mutantspore
Apr 08 2016 22:27
@fez994 url( not url : (
@fez994 your logic is working ok.. the .css is the issue
Federico Dente
@fez994
Apr 08 2016 22:30
@mutantspore OH YEAH NOW IS WORKING!! THANKS ALOT MAN
CamperBot
@camperbot
Apr 08 2016 22:30
fez994 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: fez994 already gave mutantspore points
Federico Dente
@fez994
Apr 08 2016 22:30
I'm so happy
@mutantspore Thanks again for your help and patience
CamperBot
@camperbot
Apr 08 2016 22:30
fez994 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: fez994 already gave mutantspore points
Bruce Young
@mutantspore
Apr 08 2016 22:30
@fez994 ty for doing the pen.. it’s easier for me to help that way
Brandon
@Daxo
Apr 08 2016 22:34
Hey everyone! I'm working on the Weather App and my getJSON function doesn't seem to pull anything from the API http://codepen.io/apeiron/pen/XdVxyY?editors=1011
When I enter the API call into my browser it comes back correctly but when I try to console.log() the object it returns blank
I'm assuming its some stupid syntax error that I can't find but I might just not understand the data structure
any help would be appriciated!
Bruce Young
@mutantspore
Apr 08 2016 22:36
@bleafman yep… a URL needs http://
Brandon
@Daxo
Apr 08 2016 22:36
@mutantspore ><
@mutantspore thanks
CamperBot
@camperbot
Apr 08 2016 22:36
bleafman sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1379 | @mutantspore | http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Apr 08 2016 22:37
@bleafman you’ll then need to put the getJSON inside the geolocate or wrap it in a function and call it from within the geolocate as both are asynchronous
Coryphaeus
@cvdeby
Apr 08 2016 22:37
I tried to find why $.ajax encode url twice. But real problem was in the given url. I used https://wordpress.org. I should use https://en.wordpress.org instead, because if I'm using first url, I get redirect. So simple, but I spent 3 hours to find this small problem... I tried so many CORS tricks, like crossorigin.me and headers)
Brandon
@Daxo
Apr 08 2016 22:40
@mutantspore thanks!
@mutantspore I've never heard of asynchronous functions(just googling it now). Any recommended reading that explains it?
Brandon
@Daxo
Apr 08 2016 22:48
@mutantspore thanks!
CamperBot
@camperbot
Apr 08 2016 22:48
bleafman sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: bleafman already gave mutantspore points
Federico Dente
@fez994
Apr 08 2016 22:53
How to i set the background repeat to none?
With Jquery
Bruce Young
@mutantspore
Apr 08 2016 22:58
@fez994 why does it have to be in jQuery. just do css for the body background-repeat: no-repeat;
then it’s done
and you’ll probably also want background-size: cover;
Bruce Young
@mutantspore
Apr 08 2016 23:03
@fez994 if you want it in your jQuery you can just add no-repeat after your url
Federico Dente
@fez994
Apr 08 2016 23:03
@mutantspore I done that with css but it's not working

My body body {
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-size: cover;

}

Bruce Young
@mutantspore
Apr 08 2016 23:05
 body {
background-repeat: no-repeat;
background-size: cover;
}
Federico Dente
@fez994
Apr 08 2016 23:06
@mutantspore Done, not working
Bruce Young
@mutantspore
Apr 08 2016 23:07
so what’s not working? you have an image that’s repeating?
Paul Borawski
@iAmNawa
Apr 08 2016 23:24
There is no image there
Bruce Young
@mutantspore
Apr 08 2016 23:25
@iAmNawa he’s adding that via jQuery
Paul Borawski
@iAmNawa
Apr 08 2016 23:26
Isn’t that the slowest way to add a photo?
jquery should load after all the css loads
Pawan
@pawan92
Apr 08 2016 23:40
finally finished my wiki viewer..comments are welcome! http://codepen.io/pawan92/full/zqzWYB/
Paul Borawski
@iAmNawa
Apr 08 2016 23:43
@pawan92 looks good but you spelled wikipedia wrong
Pawan
@pawan92
Apr 08 2016 23:44
@iAmNawa lol thanks
CamperBot
@camperbot
Apr 08 2016 23:44
pawan92 sends brownie points to @iamnawa :sparkles: :thumbsup: :sparkles:
:star: 361 | @iamnawa | http://www.freecodecamp.com/iamnawa
Tien Anh Nguyen
@tienanh2007
Apr 08 2016 23:46
I use a function in javascript to modify a global var but when use in the document.ready function it hasn't changed at all
How do I changed it before using it in the document ready function
Stephen James
@sjames1958gm
Apr 08 2016 23:50
@pawan92 I ran it - the second search doesn't seem to work.
Patrick Ayres
@Pat-Ayres
Apr 08 2016 23:51
@tienanh2007 what are you trying to accomplish? Do you have a codepen for review?
Tien Anh Nguyen
@tienanh2007
Apr 08 2016 23:51
Stephen James
@sjames1958gm
Apr 08 2016 23:51
@pawan92 never mind seems to work now
Tien Anh Nguyen
@tienanh2007
Apr 08 2016 23:51
trying to change the HTMLtoadd and add it
Pawan
@pawan92
Apr 08 2016 23:52
@sjames1958gm phew i was like not again! :sweat_smile:
Tien Anh Nguyen
@tienanh2007
Apr 08 2016 23:52
but it doesn't work unless it is inside the addPreview function
Stephen James
@sjames1958gm
Apr 08 2016 23:54
@tienanh2007 When you call update in document.ready the requested data has not returned. When you call it in addPreview you are processing the returned data.
Tien Anh Nguyen
@tienanh2007
Apr 08 2016 23:56
@sjames1958gm so what should I do
Stephen James
@sjames1958gm
Apr 08 2016 23:56
@tienanh2007 getChannel returns after sending the request, so update is called too soon. You have to organize your code to handle the stream data in the success handler (or addPreview which is called from the success handler.
$(document).ready(function() {
  for (var i = 0; i < channels.length; i++) {
    getChannel(channels[i]);
  }
  update(HTMLtoadd);
});
@tienanh2007 Also just so you know -
success: function(data) {
      addPreview(data);
}

can be simply

success: addPreview