« first day (3632 days earlier)      last day (1299 days later) » 

5:16 AM
hi
please someone help me out with this issue: I have a js code that populates a "select" element.
However, when i load the page, the option that is displayed as the selected one in the page doesn't match the one that was selected when i inspect the element. Anybody have an idea why this happens?
 
@IsraelObanijesu Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
```subscriptionPlans.forEach((plan) => {
        document.getElementById(elementId).insertAdjacentHTML('beforeend', `<option value=${plan.id} selected=${plan.id == subscriptionPlan ? true : false}>${plan.name}</option>`);
      });```
that is my code for populating the "select" element, but it only display the last option as the selected one in the page even when its selected value = false
 
6:25 AM
why does
let filtered_array = my_array.filter(value => typeof value === "number")
filter numbers from an array ? for me typeof value === "number" looks like checking if value is == the string "number"
 
 
1 hour later…
7:43 AM
Is it possible to deploy angular project on Sentora serve? Plz tell me i need to know.
 
7:58 AM
@Amundsen any chance that it compares (typeof value) with "number"?
 
@Amundsen typeof returns the type...
use your noggin
@vidy Angular is frontend, you can deploy it to a toaster running a HTTP server if you wanted.
 
 
4 hours later…
11:58 AM
Hello how are you doing?
 
 
1 hour later…
1:08 PM
Is there a way to open a "data thread" for saving things to localstorage in JS
I doubt it
or actually... a better question
is there a way to quickly save some variables to localstorage before the page closes?
 
why not just save changes when they happen?
but the onbeforeunload event could work
 
Well
I was just toying around and Im working on another clicker game, and I dont want my data to not get saved, as its constantly updating.
hopefully that makes sense
I cant just save every single animation frame
or maybe I can
Im not sure
 
1:49 PM
hey, since object variables are similar to classes... is there a way to define a constructor within an object aswell?
 
2:05 PM
Hii, can somebody review this question stackoverflow.com/questions/64065525
 
@HarisKhurshid Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
tags don't belong in the title
 
 
1 hour later…
3:11 PM
Hello and good morning.
If I have a #text node, how can I with javascript add to it's innerHTML? I suppose from the attempts I have been making that #text nodes do not have innerHTML. But suppose I want to add some html to it... using Node.innerHTML has no effect on the DOM, changing Node.nodeValue won't parse the HTML tag i am trying to add..
I ask this because I have a Range that has the startContainer as a #text node. I just want to add an opening <span> tag to it on the range startOffset
 
Hello, I want to export every module in NodeJS and I have a ES6 snippet: export * from './file1';, however I do not use ES6 but the standard CommonJS and my question is, how you can export everything in CommonJS
 
@Steven2105 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
4:21 PM
@Steven2105 module.exports = {...require('./file1')};
idk, that may work
 
Gday
 
So I take it you cant insert anything into a #text node
well darn
 
4:39 PM
whats symfony
 
5:19 PM
When requesting a POST with ajax, for one of the HTTP headers, how do you find the
"content-length": <length of post body>,
 
5:40 PM
https://repl.it/@skylerspark/Clicker-Currency-API#script.js

hey, Im trying to use an interval to count up....
Im using an arrow block
why is this showing NaN for my values
I thought the this context stayed the same if you used an arrow block
This is the block causing the issue
	updateUpgrades() {
		if (this.loopInterval) {
			clearInterval(this.loopInterval);
		}
		this.loopInterval = setInterval(() => {
			this.currency += this.autos;
			console.log(this.currency += this.autos);
			console.log(this.currency, this.autos);
		}, 1000);
	}
oh ma god
Im a fking idiot
I forgot to initalize thos.autos
yeah its working now
		this.autos = 0;
sigh
 
6:42 PM
ofc you can
but it's a text node
it can only be what it is
@bigchungus request headers? response headers?
seems like that should be documented somewhere
 
 
2 hours later…
8:15 PM
$.ajax({
		url: requestUrl,
		type: "POST",
		contentType: "application/json;odata=verbose",
		data: JSON.stringify(item),
		headers:{
			"Accept":"application/json;odata=verbose",
			"X-RequestDigest":$("#__REQUESTDIGEST").val()
		},
why does it tell me the '.' is unexpected??
 
which .
 

« first day (3632 days earlier)      last day (1299 days later) »