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
Sorin Ruse
@sorinr
@laurenconners you mean lazy loading of images?
ashish singh
@ashish1729
@laurenconners just remove that background attachment thing from css .. and you will see
Lauren Conners
@laurenconners
@sorinr not sure what that means. Maybe?
@ashish1729 ok
I think I understand now, @ashish1729
Thanks!
ashish singh
@ashish1729
@laurenconners cool
Sorin Ruse
@sorinr
@laurenconners do you want something like lazy loading example ?
Lauren Conners
@laurenconners
That's not what I was looking at, but I do like that. It's interesting
So that's JavaScript. I haven't learned how to do much with JS, yet.
Sorin Ruse
@sorinr
@laurenconners there is a jquery plugin for lazy loading if you like it
Adam Pankowski
@losbaltica
$(function () {
  var color = ['red', 'blue', 'yellow', 'green', 'black', 'pink', 'purple', 'grey'];
  var randomColor = color[Math.floor(Math.random ()*color.length)];
  $('.Mix_button').click(function{       $('body').css('background-color', randomColor);
                       });
});
I got problem with that... My console sad that is a problem with secound function {
I want to randomize the background color. Can you help me?
Lauren Conners
@laurenconners
Are you missing () in the second function?
function () {
Adam Jacks
@AdamHJ123
Guys, any idea why when I click the down arrow, the href doesn't leave margin at the top?
Adam Pankowski
@losbaltica
@laurenconners yep correct i already manage it, but still function do not changing background :(
need help with js part
Gabriel Alexandre
@GabrielShaad
Hey guys, can you give your opinion about my Portfolio page so far? https://codepen.io/gabrielshaad/full/BzLRdm/
Sorin Ruse
@sorinr
@shailza you need a reset to zero to your counter. you can do this by using an if statement
Adam Pankowski
@losbaltica

can somebody tell me why random color is not working properly? :(

http://codepen.io/codermaster/pen/LkvXqR?editors=1010

Shailza
@shailza
@sorinr done! :D
Sorin Ruse
@sorinr
@shailza hope this is what you wanted. to cycle the quotes over and over
ashish singh
@ashish1729
@losbaltica coilors.length
not color.length
*colors.length
@losbaltica you have not included jquery
Hong
@designBuildShipSoftware
Hi, how can I catch the error in api? I am working on twitchtv api. Here is my code:
It did not respond to the data.error in else if
Elbert Cortez
@trip16661
@designBuildShipSoftware tip one
wrap your url or long strings into variable and re use them..
Hong
@designBuildShipSoftware
@trip16661 What do you mean
you mean i need another $getJSON statement?
Elbert Cortez
@trip16661
'https://api.twitch.tv/kraken/channels/'
'https://api.twitch.tv/kraken/streams/'
can be done as
var twitchApi = 'https://api.twitch.tv/kraken/';
// and then invoked 

$.getJSON(twitchApi +  "channels"
//or
$.getJSON(twitchApi +  "streams"
Hong
@designBuildShipSoftware
@trip16661 Alright. what about error handling
Elbert Cortez
@trip16661
@designBuildShipSoftware if status 422 then obj.message
Sorin Ruse
@sorinr
@designBuildShipSoftware if(data.status === 422){alert('Account is closed');}
Hong
@designBuildShipSoftware
@sorinr did it work for you? It did not show any alert
Elbert Cortez
@trip16661
@designBuildShipSoftware and if that doesnt work use the error handler from the get
@designBuildShipSoftware
.fail(error => console.log(error));
sorry for es6 syntax
$.getJSON(function() {... your code}).fail(function (error) {
console.log(error)
});
Hong
@designBuildShipSoftware
@trip16661 you are making me more confused. But I will try what you said since it looks interesting
Elbert Cortez
@trip16661
@designBuildShipSoftware ok the get method from jquery, the one you use for ajax requests have a build in error handling function. which do something if an error in the get is throw
Tyler Moeller
@TylerMoeller
@trip16661 This won't give them errors from the API, only jquery-related errors accessing the API. They need to test the JSON to look for valid properties - if none exist, account is closed, if data.stream is null, account is offline, else they're online.
Elbert Cortez
@trip16661
@TylerMoeller who said that it doesnt give them errors from the api?
Tyler Moeller
@TylerMoeller
@trip16661 Do you have a working example showing errors coming back from the Twitch API in the .fail() method?
Elbert Cortez
@trip16661
it throws errors from the get functions but it grabs any object or error the api throws as well
@TylerMoeller use his code and use the fail method