Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Victória Simonetti
@victoriasimonetti
Hi, how can I put images from my pc in codepen? we need a special account for hosting?
Dick Fink
@dickfink
@victoriasimonetti you need to host them somewhere online and point to the URL, there are lots of free services which do that (imgur.com comes to mind)
rodascesar
@cesarrodas
@dickfink thanks, i'm interested in getting mines to work, however. I thought I want close.
CamperBot
@camperbot
cesarrodas sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 169 | @dickfink | http://www.freecodecamp.com/dickfink
Hiresh
@hiresh
       $.getJSON('https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&prop=extracts&exlimit=max&explaintext&exintro&exsentences=1&gsrsearch=suits&callback=?',function(json){
    json = json.filter(function(val) {
  return (val.index !== 1);
});
    $(".message").html(JSON.stringify(json));

      });
json is not filtered, help please
Victória Simonetti
@victoriasimonetti
@dickfink thanks! =)
CamperBot
@camperbot
victoriasimonetti sends brownie points to @dickfink :sparkles: :thumbsup: :sparkles:
:star: 170 | @dickfink | http://www.freecodecamp.com/dickfink
Hiresh
@hiresh
is there any1 , who can help?
Dick Fink
@dickfink
the index you’re calling in that code indicates " indicates the 0-based position of the element within the unfiltered set of matched elements"

eg if you had a page with a bunch of “li” elements:

$( "li" )
  .filter(function( index ) {
    return index % 3 === 2;
  })
    .css( "background-color", "red" );

would cause third and sixth list items to be highlighted.

i think you need to iterate through each of the “pages” object and filter out the one that has pages.index === 1
(but i’m just learning too, so take what i say with a grain of salt)
Maulik Darji
@maulikdarji
Wenceslao Villegas Marset
@SpiralOut17

Hi i need help in the Weather app zipline
I dont get a response from the openweather api, if i put the urrl in the browser searchbar it loads but when i call it with the ajax jquery function i get nothing.
Here is my code:



$(document).ready(function(){

  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position){
      var apiUrl= "api.openweathermap.org/data/2.5/weather?lat="+ position.coords.latitude + "&lon=" + position.coords.longitude + "&units=metric&APPID=388b9dfad805b961ba54355aedb86991"
     $.ajax({
       url:apiUrl,
       success: function(weather){
         console.log(weather);
       },

     })
    });

  }else {
    $('#location-header').html('Geolocation is not available')
  };


});

Thanks
Here is the pen link: http://codepen.io/SpiralOut17/pen/XXQmxM?editors=0011

Lanitta
@DivaWeb
hello all
how is everyone today?
Wenceslao Villegas Marset
@SpiralOut17
@DivaWeb Great! you?
LDiek-
@LDiek-
i have got a problem programming the weather app
i cant get my longtitude
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- Im working on that ziplite too
Lanitta
@DivaWeb
@SpiralOut17 lol I almost through my computer through the window over a space in my code lolololololo
LDiek-
@LDiek-
@SpiralOut17 i've seen it in CodeReview :D
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- Haha i just solved that problem i had
LDiek-
@LDiek-
what was the problem?
@SpiralOut17
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- I couldnt get the JSON from the api because i was missing // at the beggining of the url
@LDiek- I was going nuts
LDiek-
@LDiek-
@SpiralOut17 do i need the // always in js urls?
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- apparently it allows either http and https so it works with either
LDiek-
@LDiek-
hmm ok thx
Hiresh
@hiresh
@dickfink but the error I am facing in console is "filter is not a function"
LDiek-
@LDiek-

@SpiralOut17 I dont get any longtitude nor an output in the div with the class "weather".This is my code:`function printweather(pos) {
var lon = pos.coords.longtitude;
var lat = pos.coords.latitude;

var url = "//api.openweathermap.org/data/2.5/weather?lat="; + lat + "&lon=" + lon + "&units=metric&APPID=6ffb926f18657b3913623a729923200f";
$.getJSON(url, function(data) {
$(".weather").html(data);
});
}

$(document).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(printweather);
}
});`

function printweather(pos) {
var lon = pos.coords.longtitude;
var lat = pos.coords.latitude;

var url = "//api.openweathermap.org/data/2.5/weather?lat="; + lat + "&lon=" + lon + "&units=metric&APPID=6ffb926f18657b3913623a729923200f";
$.getJSON(url, function(data) {
$(".weather").html(data);
});
}

$(document).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(printweather);
}
});
oh the indents are gone :O
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- You are not getting output because you are not getting nothing from the api since the lon variable is empty
LDiek-
@LDiek-
@SpiralOut17 do you have an idea why lon could be empty?
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- Try using the position.coords.longitude and dont use the variables in the url
@LDiek- you can put the var url within the if statement and call the api from there
LDiek-
@LDiek-
@SpiralOut17 ok i have got an output now... i just had to stringify the data object :D
but still i have got the {"cod":"404","message":"Error: Not found city"} message @SpiralOut17
Wenceslao Villegas Marset
@SpiralOut17
@LDiek- Did you get de longitude?
LDiek-
@LDiek-
no
@SpiralOut17 i just spelled longitude longtitude... thanks for your help!:D
CamperBot
@camperbot
ldiek- sends brownie points to @spiralout17 :sparkles: :thumbsup: :sparkles:
:star: 279 | @spiralout17 | http://www.freecodecamp.com/spiralout17
Wenceslao Villegas Marset
@SpiralOut17
This message was deleted