Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 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
so your get offline is supposed to be a seperate API call, right?
I was going to use two diffent api calls to get the info I need
if you have a different idea on how I can generate the info for the different channels, I am open to suggestions
where are you calling getOffline?
I took it off. it was at the very bottom
it generates a very weird result
I figured the weird result was because I was not inferring what indexes of channels to apply getOffline to
I am still looking, I am not really sure if I can help with this format, ive done them very differently
what did you do
am I completely off the mark
I don't think you are, but I wouldnt do a seperate API call
for offline channels
I didn't have access to logos within the stream call, so I did one call for all channels to /channels/ to get the logo, and then a different call to get the stream info
what I would do is have the offline function just take in one argument for the channel you need to do a separate call on
and then an else after the if(response.stream!=null) that will call that separate API call
if that makes sense
hard part is to get to the response.stream you need to be in a request
I had everything inside of the getJSON
what do you mean all in everything inside getJSON
give me a second and I can make an example
helpful :)
here we go
sorry that took so long
so you can see in that example, if data.stream is false, the if statement on line 11 wont fire
so it then goes to the else on line 14, and calls getChannel, passing the channel that did not have data.stream
I like ajax alot more
the way you did it?
no I used getJSON
ah, right
I like $.ajax more
I do too, but you can do simpler getJSON calls as well
Martine Ross
@sziko no problem just glad it worked
Baha Aiman
Thanx @sorinr
bahaaiman sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1013 | @sorinr |http://www.freecodecamp.com/sorinr
Baha Aiman
For wikipedia viewer I'm getting the error : "Refused to execute script from 'https://en.wikipedia.org/w/api.php?%20%20%20%20format=json%20%20%20%20&acti…plaintext%20%20%20%20&exsentences=1&exlimit=max&gsrsearch=Albert&callback=?' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
Please help
var app = angular.module('wikiApp', []);
app.controller('myCtrl', function ($scope, $http) {
    $scope.searchUrl = `https://en.wikipedia.org/w/api.php?

        function (data) {
            var results = data.query.pages;
            angular.forEach(results, function (v, k) {
                $scope.results.push({ title: v.title, body: v.extract, page: page + v.pageid })


Here's the code
Sorin Ruse
@BahaAiman think you should add into the url that you request a json dataType return. just a sec
Sorin Ruse
@BahaAiman maybe here format=json you should have &format=json
did that work?
the above code looks good to me. Just append '&'
Hello everyone!
I am stuck with the 'Counting Cards' Javascript challenge

Following is the code:
var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count += 1;
case 7:
case 8:
case 9:
count += 0;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count -= 1;


if (count <= 0) {
console.log (count + " Hold");
} else
console.log (count + " Bet");

//return count;
// Only change code above this line

// Add/remove calls to test your function.
// Note: Only the last will display

cc(2); cc(3); cc(4); cc(5); cc(6);

I am not getting any output. Any ideas?