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
Narendro
@Narendro
any idea.. how to make picture fit in whole screen without need to scroll it down
Paolo
@mav1283

Hi guys im new here and i'm on intermediate front-end development project, working on "Build a Random Quote Machine";

i created a quotes.json file, not really sure if it's going to work but this are the content on it

var quotes = [
{
quote:"Just a sample string",
author:"Mark"
},
{
quote:"Welcome to the javascript Programming",
author:"john"
},
{
quote:"Free Code Camp",
author:"Paolo"
}
];

just a temporary quote for testing and i'm not really sure how am i going to get them but on my script i just copied the codes on the previous exercise and tweek it, here's my code

$(document).ready(function(){
$("#quote-control.btn").on("click",function(){
$.getJSON("/json/quotes/quotes.json", function(json) {

  var quoteLayout = ""; //html structure container
  json.forEach(function(val){
    var keys = Object.keys(val);
    quoteLayout +='<blockquote class="custom-quote">';
    keys.forEach(function(key){
      quoteLayout +='<h1 class="custom-quote">'+key+'</h1>';
      quoteLayout +='<footer class="text-center text-yellow">'+key[val]+'</footer>';
    }); 

    quoteLayout +='<blockquote class="custom-quote">';  
  });


  $("quote-message-container").html(JSON.stringify(json));
});

});
})

it's not working, at the moment i can't figure out how to output

bscyrpt
@bscyrpt
hey guys, just finished my tribute page with first foray into hand coding it to be responsive, looking for ideas or any critiques you guys might have here is the site http://scyrpt.us/
Quoc Anh Nguyen
@quocanh261997
hey guys I'm doing the Random Quote Generator and my API is not working. Any suggestion? or can you guys suggest me some API?
vijayalakshmi S
@vijayalakshmiS
hai
bscyrpt
@bscyrpt
@quocanh261997 can you post the codepen? so we can see your code
Quoc Anh Nguyen
@quocanh261997
CamperBot
@camperbot
quocanh261997 sends brownie points to @bscyrpt :sparkles: :thumbsup: :sparkles:
:cookie: 9 | @bscyrpt |http://www.freecodecamp.com/bscyrpt
bscyrpt
@bscyrpt
@quocanh261997 i think its because your trying to use the $.getjson method , when that url doesn't take json, but a normal get ajax request
so change it to $.ajax({
dataType: "json",
url: url,
data: data,
success: success
});
Andrea
@dredelion
Hey guys, need help with the Record Collection challenge in Javascript, can’t seem to get the second task checked off
bscyrpt
@bscyrpt
method:'get'
Quoc Anh Nguyen
@quocanh261997
ok thanks, I'll try it :D
bscyrpt
@bscyrpt
@dredelion gotta post your code
Andrea
@dredelion
// Only change code below this line
function update(id, prop, value) {
if(value !== "" && prop !== "tracks"){
collection[id][prop] = value;
}else if(!value){
delete collection[id][prop];
}else{
collection[id][prop].tracks.push(value);
}
return collection;
}
bscyrpt
@bscyrpt
find record collection challenge
CamperBot
@camperbot
find record collection challenge
nothing found
Andrea
@dredelion
function update(id, prop, value) { if(value !== "" && prop !== "tracks"){ collection[id][prop] = value; }else if(!value){ delete collection[id][prop]; }else{ collection[id][prop].tracks.push(value); } return collection; }
Shusil Banjade
@shusil123
@dredelion , check if the collection id hasownproperty (prop) when prop=tracks; Because in the second condition you need to push the value to the array tracks. And object #5439 doesn't have tracks array. So you need to create the empty array and then push the value for those that doesn't have tracks
And you have problems in the if , else if , too
Andrea
@dredelion
@shusil123 got it, thanks!
CamperBot
@camperbot
dredelion sends brownie points to @shusil123 :sparkles: :thumbsup: :sparkles:
:cookie: 390 | @shusil123 |http://www.freecodecamp.com/shusil123
Shusil Banjade
@shusil123
@dredelion , My pleasure
Nikhil Goyal
@ngoyal100894
can anyone explain this part to me .. haven't done much of jquery
$(document).ready(function () {
  $('#get-data').click(function () {
    var showData = $('#show-data');

    $.getJSON('example.json', function (data) {
      console.log(data);

      var items = data.items.map(function (item) {
        return item.key + ': ' + item.value;
      });

      showData.empty();

      if (items.length) {
        var content = '<li>' + items.join('</li><li>') + '</li>';
        var list = $('<ul />').html(content);
        showData.append(list);
      }
    });

    showData.text('Loading the JSON file.');
  });
});
just need to understand this <Li >part
What is happening here ..
Narendro
@Narendro
hi guys... need your review
trần nguyễn minh anh
@Anntran2222
i forget how to make the words italic. can someone show me?
Narendro
@Narendro
font-style: italic;
thekairath
@thekairath
@Narendro navs/content empty, and there is a space which looks bad at slider but other than that very nice.
@Anntran2222 or are you looking for <em> tag?
trần nguyễn minh anh
@Anntran2222
yeah
but i forget how to use it @thekairath
Narendro
@Narendro
@thekairath navs/content empty? i don't get what you mean... yeah i miss calculated image size for the slide
<em>hello world</em>
@thekairath did you mean no link for Jobs and Contact Us? I haven't work it yet
thekairath
@thekairath
yup
pgjones72
@pgjones72
hey guys, for the Twitch viewer thingy, do we have to register for Twitch or get a key to access their API?
Rune Bak Jacobsen
@runebakjacobsen
@pgjones72 No i don't have to register
pgjones72
@pgjones72
@runebakjacobsen Thanks! Now I just have to figure it out :)
CamperBot
@camperbot
pgjones72 sends brownie points to @runebakjacobsen :sparkles: :thumbsup: :sparkles:
Rune Bak Jacobsen
@runebakjacobsen
@pgjones72 there is a example of how to use it in the assignment
pgjones72
@pgjones72
@runebakjacobsen Yeah. I still have problems figuring out how it works and how to apply it
Greg Duncan
@GregatGit
@pgjones72 here is a url to play with - put one of the channels at the end https://api.twitch.tv/kraken/streams/
juw3lstar
@juw3lstar
This message was deleted
ERWIN JOHN T. CARPIO, MD, FPCR
@RadEdje

Hi everyone.... I was hoping to ask for help regarding the wikipedia viewer project.

I can get the json from wikipedia with jquery

I can build the url or wikipedia api request and plug it into my var wikiSearch
using

$.getJSON(wikiSearch, function(json){});

but I can't seem to parse the result? firefox sends this error message

SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

so what is the difference between json and jsonP? Am I suppose to convert the response to jsonP?

Is jquery the problem?

Do I have to make a manual AJAX request using xhttp and then manually convert the text response?

Basically after getting the json

After plugging in

console.log(json);

I don't get anything. I can't access the json childs either with json[0][0]
or even with json.continue.plcontinue etc.

Any advice would be much appreciated.

Thanks!