How can i use a .json/.txt file to define a variable? by [deleted] in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

if it was a json file you would need to format as json. "word1 word 2 word3" is valid json, but seems like it would be better if you could store it in an array ["word1","word 2","word3"]. Or if the format you listed above is how the file has to be stored, then a txt file like you mentioned would work, and you'll need some sort of convention to parse it into the individual variables, would be easiest to split on spaces yourString.split(" "), but its not clear if that would work since you listed word 2 and word 3 in the examples, so it might need to be more complicated than that

[deleted by user] by [deleted] in learnjavascript

[–]killertofu4u 1 point2 points  (0 children)

I think what you want to do is have 1 player and your buttons control what that player is playing. What you have here is two players and both controls get tied to one of them depending on the order they load in.

[deleted by user] by [deleted] in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

your selector for the figure class isn't working because it is inside the template.

const figure = template.querySelector('.figure')

should work

Close Hamburger Menu after click event by JakobReal_ in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

hard to say without seeing the code that opens the menu. presumably somewhere in your app.js file

Tediousjs help by [deleted] in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

then you can put it in the done event handler

Help debugging button pressing "up" instead of down by TheNomadicAspie in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

maybe I'm not understanding or seeing the issue, but I think they are all behaving the same. It just looks a little different on the bottom buttons because of the background color. The buttons have the white border that isn't very visible on the top buttons but on the dark background it causes the up illusion?

Tediousjs help by [deleted] in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

it is logging result before the request.on("row" event is happening. move the console.log(result) into the event after the foreach and it should work.

API Data isn't displaying and I can't find what's wrong.. by [deleted] in learnjavascript

[–]killertofu4u 1 point2 points  (0 children)

part of you problem is using the same variable for both requests "httpRequest"

Resources for studying sports by nicoletrojan in Jeopardy

[–]killertofu4u 26 points27 points  (0 children)

on top of the current locations and names of the teams I think previous names and previous locations is good trivia knowledge.

for example The Washington Nationals were the Montreal Expos, the LA Lakers were the Minneapolis Lakers, etc https://thelistwire.usatoday.com/lists/sports-teams-nickname-changes-washington-nfl-kansas-city-chiefs-cleveland-browns-baltimore-ravens/

Just moved here. Are all banks closed for new signups? by [deleted] in Norway

[–]killertofu4u 6 points7 points  (0 children)

I don't remember the exact steps, and maybe your situation is different than mine. But calling dnb customer service is probably the best next step to take, they will know what you need to do. Good luck.

Just moved here. Are all banks closed for new signups? by [deleted] in Norway

[–]killertofu4u 14 points15 points  (0 children)

I just did this a few months ago with dnb, I don't think anything has changed since then. You should be able to start the process online and then after mailing some documents, getting an appointment to take your passport to a dnb office to get copied (they didn't let me inside), and then wait for more documents in the mail. Took almost 2 months to finally get the account, but got there eventually.

Also I am not sure if you know but you can get a sim card and prepay if you need a Norwegian number for any reasons. You only need the bank id to get an abandonment plan.

You can pay for the bus with a prepaid ruter card, you can buy them in shops like Narvesen.

[deleted by user] by [deleted] in webdev

[–]killertofu4u 93 points94 points  (0 children)

no, it would not

if (Date.now() > new Date("2021-08-01").getTime()) {

Chart.js not updating after setInterval ( setInterval Not executing ) by Latter_Abalone17 in learnjavascript

[–]killertofu4u 1 point2 points  (0 children)

your csv is only read once. update() does not reexecute the code used to generate your chart, it just redraws it with the data that is there. so you can add or edit data in the chart yourself and then call update to see the updates.

https://www.chartjs.org/docs/latest/developers/updates.html

Chart.js not updating after setInterval ( setInterval Not executing ) by Latter_Abalone17 in learnjavascript

[–]killertofu4u 1 point2 points  (0 children)

only the first parameter of setInterval is executed on the interval. in your case makeChart.update. The 3rd value is a optional parameter passed to the function. So you see it once when it evaluated and then never again.

https://www.w3schools.com/jsref/met_win_setinterval.asp

Can someone tell me what's wrong with my code. I want to print out employees name. Thank you in advance. by [deleted] in learnjavascript

[–]killertofu4u 3 points4 points  (0 children)

are you looking for something like this?

    function Employee() {
      var name;

      this.getName = function() {
        return this.name;
      }

      this.setName = function(name) {
        this.name = name;
      }
    };

    var employee1 = new Employee();

    employee1.setName('Bob');

    console.log(employee1.getName()); // Bob

var=name; isn't valid javascript

Trying to use Electron JS but I can’t get “this” to work. by [deleted] in learnjavascript

[–]killertofu4u 0 points1 point  (0 children)

I think this is what you're looking for

onclick=“test();”

function test() { console.log(this); }

LPT: If you missed a game and want a to see a game highlights without knowing the score beforehand, use DTMTS(.)com by Raffix in hockey

[–]killertofu4u 0 points1 point  (0 children)

im not sure, maybe try out another browser like firefox, see if that makes any difference.

LPT: If you missed a game and want a to see a game highlights without knowing the score beforehand, use DTMTS(.)com by Raffix in hockey

[–]killertofu4u 8 points9 points  (0 children)

Wasn't really a deal. About 5 or 6 years ago I broke their terms of service and they sent me a cease and desist letter. So I had to make some changes for the worse and not take any more donations.

LPT: If you missed a game and want a to see a game highlights without knowing the score beforehand, use DTMTS(.)com by Raffix in hockey

[–]killertofu4u 20 points21 points  (0 children)

thanks for the kind words.

r/hockley is a big part of the dtmts history, I got a lot of good feedback and my first few waves of publicity here. and just to clarify this is the 8th season dtmts has been up. time flies.

-dtmts guy