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
Stephen James
@sjames1958gm
@gothamknight You could do
changeDuration.bind(this)(e, wDuration, bDuration);
Hmm that may not work either, with an arrow function, you might need to make it a non-arrow function so the correct this is bound in the callback
Ashwin
@ashwins93
@gothamknight well your this refers to the enclosing scope when an arrow function is used
the enclosing scope is window.onload's function
so window is this
i guess
Markus Kiili
@Masd925
@ashwins93 It is not even inside onload callback. Just a normal function.
Ashwin
@ashwins93
window.onload = function(){ doesn't this have a scope ? :thought_balloon:
Markus Kiili
@Masd925
@ashwins93 Yes, but when changeDuration is called and executed, its variable values are determined lexically (determined from how the function declaration sits in the code in respect to other functions). Where it is called from doesn't matter.
Ashwin
@ashwins93
yeah arrow functions are lexically scoped
that's why i'm asking isn't the arrow function placed inside the curly braces of the outer function ?
i mean arrow functions have lexically scoped this captured at the time of declaration
aka not dynamically bound
Markus Kiili
@Masd925
@ashwins93 Yes, but nothing here sets this into anything else than window. Normal functions and anonymous functions all have this pointing to window.
And onload callback is anonymous function.
Ashwin
@ashwins93
yeah so the window is this
the onload resides on the window so this inside onload is window isn't it?
Markus Kiili
@Masd925
@ashwins93 If you used this inside onload callback, it would point to window, because the callback is called as a method of window object, yes. But here this is not used inside onload callback function.
Ashwin
@ashwins93
okay its used inside changeDuration
which has its own scope
which resides in global scope
Markus Kiili
@Masd925
@ashwins93 It is easiest to think that this points to the global object if it is not set to anything else. Just check the MDN this page for the special cases where it is set to something else.
Ashwin
@ashwins93
hmm i've seen those in the YDKJS book
have to review them
AbrisM
@AbrisM
https://codepen.io/anon/pen/KyLNjb Hi, does anyone know how to keep the footer at the bottom of the page and also to stop the page from stretching way down? There's few content but the page is over its limits
Marc
@MWBauer
Morning everyone
AbrisM
@AbrisM
@MWBauer hello
Marc
@MWBauer
How's AbrisM
?
@sjames1958gm You here?
Stephen James
@sjames1958gm
I am here, but not there, and certainly not everywhere.
Marc
@MWBauer
We need to work on your #everywhere skills, bro
lol
I'm trying to display the actual weather that's being called from the weather site.
gimme a hand?
Stephen James
@sjames1958gm
Sure
Stephen James
@sjames1958gm
Looks great - every site should have json displayed
Marc
@MWBauer
The display is cruddy. Can we clean it up?
I've seen some of the examples on Codepen and I'm blown away
I don't know how much skill or practice these people have had, but it's incredible what some of them have done.
I'm struggling to just make it readable and look good
Stephen James
@sjames1958gm
As design goes I am not the best.
Isaiah Trembley
@IsaiahCT
that is really cool
Stephen James
@sjames1958gm
@MWBauer where I am the weather is clouds, which isn't in your array
Marc
@MWBauer
But you see how it has the : around everything. Can we do away with that?
I need another image?
ack. brb
Stephen James
@sjames1958gm
Not sure what the : around means.
I just did this to handle the situation
    if (!URL) URL = images["clear"];
    $("body").css("background-image", `url("${URL}")`);
AbrisM
@AbrisM
Hello all, just working on a webpage atm :)
Stephen James
@sjames1958gm
I prefer template strings when making these kinds of strings with embedded quotes