« first day (2853 days earlier)      last day (2320 days later) » 

18:00
it means the server is not sending enough info to the brower
so is this like a cors issue or something
cors would error
user1596138
@azamkhan is your website cigarstudio.com? Or cigrastudio.com like your About says? One seems to be unregistered
no error likely means that onprogress isn't run (for whatever reason, can't see what xhr/fetch thing they're using) or the jQuery selector matches nothing
my guess is the latter
No its not my website.. and I am not sure why its there on my profile @LadyBird
18:02
some console.log's would be very helpful to you
see if onprogress even runs
if it does, look at the selector
and make sure the math doesn't result in NaN
okay..
oh I missed the "no error"
ok i am posting the question perhaps it will make more sense then
user1596138
@azamkhan Bizarre
user1596138
18:05
Are you using your StackOverflow account?
@JBis lol, did you just ignore me about the onload options?
user1596138
Really strange to have your profile say you work for a company... And then you say "No clue why it's there"
hahahahahah
@rlemon your imshr dish load type = on load
18:07
I was showing you the default.
and where the menu is
oh
20 mins ago, by rlemon
you want no-wrap head
@LadyBird I don't work for anyone.. and sorry I did not check my profile ...
@rlemon my bad
well anyways. if your JS is in the head and you need to wait for the body to be parsed. window.onload does that
it doesn't wait for images to be downloaded, or iframe content to render
user1596138
18:08
Well right but... Someone put it on your profile. It's not like you have to check when you make an account to see which random company it says you work for?
user1596138
Nvm, I don't care lmao.
@rlemon it shouldn't need to
but the jsfiddle isn't working either I don't think
if you need to access the dom, yes you need to
@JBis it runs the function and alerts 5 for me
@lad
@LadyBird okay I removed that
yeah
user1596138
18:10
Cool. /me remains on high suspicion
that worked in orig too
No need.. I am trying to write code for my own Q&A website
putit+='<div class="grid-item"><a href="'+ list.getElementsByTagName("TR")[i].getElementsByTagName("TD")[1].getElementsByTagName("a")[0].href+'"> <div style="info-cont"><img src="/theme/placeholder.png"><div class="info"><div id="name">'+list.getElementsByTagName("TR")[i].getElementsByTagName("TD")[1].getElementsByTagName("a")[0].innerHTML+'</div><div></div></div></div></a></div>';

        }
        document.getElementById("list").innerHTML = putit;
that doesn't work
@LadyBird
@JBis that alerts nothing tho
18:11
@rlemon the alert was to make sure it was loading the elements for debuging purposes
@JBis okay, then check the console in my version
> Cannot set property 'innerHTML' of undefined
you have no element with the id 'list'
you have 'indexlist'
yeah check my new one forgot to copy that over
you're gonna have to send me a new link
alright
0
Q: What is the purpose and usecase(s) of taking an object [property] and setting it to another object?

Christian MatthewThe question i have is why or when should one decide to take an objects property and set it to another object. For me, it seems like inheritence "setting" is the reason but I am not 100% sure. Furthermore, I am not sure when i should think of this and in what situations I should decide to use su...

lol hopefully i have fully explained my issue and question here
@JBis that still has all three mistakes I've addressed
sorry, only two
I see the new HTML now
@rlemon If you mean the DOM/varible thing from before I know. I am working on it.
@rlemon thats working
18:19
probably also don't need the timeout now
unless you really do want a janky delay between things
what did you do?
@ChristianMatthew i mean... you need to do so when you need to do so.
@JBis changed the onload options and used window.onload like you should have stuck with
those were fixed in all my versions. when you added the remaining HTML you didn't take my changes
so how do I fix on site
the purpose of doing so is the very thing you're doing, storing a property from object a in object b.
18:23
@JBis window.onload = load;
and include your <script>'s in the head
@rlemon ok. its in the body. I can't put in head.
where in the body?
window.addEventListener('load', load, false);
@rlemon above of html
move it below all the HTML and you don't have to wait for anything
the page is parsed top to bottom
18:25
it should still wait for bottom to be loaded though
	<body>
    <all the HTML>
    <script>
      // you don't have to wait any more. this is the same as window.onload
    </script>
    </body>
just saying. you can still use .onload before the HTML
but this is easier (imo)
@rlemon how
in the exact same way..
window.onload = load;
yes
18:27
doesn't work
in body above html
does this code get injected after the page has loaded?
not sure I don't think so
how would I check?
you control it
you should know
"The HeaderName directive sets the name of the file that will be inserted at the top of the index listing"
no no
that's some apache shit
18:30
yes
that has nothing to do with this
thats what's putting it there
putting in where?
on the page in the body
that has no idea what a body or a head is, it prepends it to a file.
tmk
18:32
ok
doesn't work if I put it after html either btw
then you're doing something else wrong
it works
idk what I could be doing wrong. When i run via console it works.
if I set the timeout to 2000 it works
show me your entire code
all of it
can't copy and paste entire code
has "sensitive" info
I can copy and paste relevant things
we've been doing that
doesn't seem to be solving much
:P
18:39
56 mins ago, by rlemon
@JBis I'm not as dumb as jake looks
wtf if I set to 1001 it works
browsers don't care if two timeouts end at same time right?
@JBis put debugger; in front of the window.onload statement. Explore the state of the document at the time it is called.
anything under 1000 doesn't owrk
@jake ok what should I look for
Are you setting defer or async on any <script> tags?
the entire timing thing just makes me believe you are waiting for the dom to load
but with a timer
that isn't reliable.
18:42
yes yes and yes
thats why I want to fix
and the proper solution is to wait for an onload event
and ditch the timer completely.
yes
.yes
ok
@JBis Look at the callstack and Scope section in the chrome debugger
yes .yes. ye yesyes yesye yES yeAhh yeas yes
see if there is a global reference to load
try and call them in the console while you are paused
18:45
not loaded
what is the exact output?
TypeError: undefined is not an object (evaluating 'list.getElementsByTagName')
editTVlinks — XXXX:204
Eval Code
evaluateWithScopeExtension
_evaluateOn
_evaluateAndWrap
Global Code —XXXX:93
and the items on page haven't loaded yet
are you still using document.onload = load;?
window.onload = load; so no
505
Q: window.onload vs document.onload

Chris BallanceWhich is more widely supported: window.onload or document.onload?

don't mix those up
18:48
ok
Who wants some WAT fun and riddles?
the problem is not the app, i just need this redirect from WP ajax, the problem is with the ajax redirect not app! You don't understand my question, you just read the question title! — Edo 28 secs ago
I like how people go from having a problem to being experts about their problem when they don't get the answer they want
So we all know the common use for let to avoid wrapping an asynchronous call in a closure inside of a for loop, like so:
user1596138
Such energy
`TypeError: undefined is not an object (evaluating 'list.getElementsByTagName')`
It looks like load is being called
18:50
for (let i = 0; i < 2; i++) {
  setTimeout(() => console.log(i));
}
All fun
@jake load is being called but there are no elements on the page. as seen in code and visually.
Now consider this: the let isn't actually inside of the block
@MadaraUchiha first time I encountered this I used bind instead :/
The ES spec actually has a special case for for loops in this scenario
user1596138
18:51
I like where this is going
@KevinB i cleaned up the question a bit if that helps
Before I move on to the question
What happens here is that supposedly each iteration of the loop has its own version of i
But if that's the case, then how does the i++ work?
i = i++
@ChristianMatthew i don't understand the wording of your last comment.
I assume
user1596138
18:52
1 min ago, by Madara Uchiha
The ES spec actually has a special case for for loops in this scenario
@rlemon Right, so basically what happens is that the value of i is copied to the new version of i
Guys, is this chat about the opinion based question in JS? :)
But then the question I'll ask is when does the i++ run?
user1596138
What does it actually do @MadaraUchiha?
it's just a chat, loosely on the topic of javascript
18:53
@MadaraUchiha well, after the body is run ofc.
So we can talk about anything, right :d
Who plays clash royale here or csgo?
anything... ish
wanna join me?
@rlemon Ah, but then the copy won't get a chance to run
But I digress
user1596138
I assume it runs at the end, then at the start of each iteration a new lexically scoped var is created that is equal to i
18:55
set i
check i
run body
get result of incrementor
assign result of incrementor to the next loops i
Keeping all of that in mind, and without running the code
What would the following do?
for (let i = 0; i < 2; i++) {
  setTimeout(() => console.log(i));
  i++;
}
1,2
user1596138
Every logged value will be +1 what you expected
i++ is run before the tick on the timeout
my guess
user1596138
My guess too
18:56
@rlemon @jake If I put the JS after html then when the debugger hits there is no content but then a second later it appears. If I run the function from console then it works, but if I let it load it does do it by itself.
user1596138
Idk that might actually be a race
@JBis this is why I want to see your entire code.
@JBis Without seeing the code, it sounds like a scope issue. I would read up on the considerations when using live HTMLCollections stackoverflow.com/a/15763707/6091685
there is shit going on here we are not prevy to
user1596138
How do I know what runs first when it's a setTimeout with no timeout
user1596138
18:56
Yeah, okay. I stay agreeing with @rlemon's prediction
it default to the minimum timeout
@LadyBird Then the default is as though I passed 0 to the second parameter
which is browser dependant
but always > 1ms
@JBis thats bc it waits for paint
user1596138
Can I run it now or do we need to wait for further info
18:57
@KevinB i put the exact comment in the edit of the question as it wouldn't let me put code in the comment
I want to say the default min is 4ms, but I feel like I read they changed that
@jake but why does it work when I run it but not run automatically
@ChristianMatthew I already answered that question.
user1596138
I say you get 2 values, since the i++ inside the loop won't affect the fors index. So it's not like you hit i < 2 any sooner, but your values are inflated
That line is part of the process of constructing an object to be passed to setState. That is the purpose of doing so in this case. the object needed said property with said value. There is no deeper meaning to this construct. — Kevin B 28 mins ago
18:58
@LadyBird ohh yea, I didn't even consider that it would exit early.
duh
the state needed said properties
for whatever reason
1,3
user1596138
Well I don't think it wil exit early
and so it was given them
and wouldn't I get an error if it couldn't find the elements?
user1596138
18:58
I say 1,2, but I bet the answer is 0,1 and @MadaraUchiha is going to enlighten us
@LadyBird yea, but thinking about that, it makes sense it would skip an index that can't be hit
user1596138
No way it's 1,3
the setTimeout is registered then it is incremented again
past the final index
So what happens here is
i is initialized to 0
Then the timeout gets registered
Then i is increased to 1
@KevinB when i console out that array... I would expect that the object is the same except for the property fileName which I would expect to be the object of the currDownloadObject...
18:59
That ends that scope, because the loop then continues on to the next iteration

« first day (2853 days earlier)      last day (2320 days later) »