Skip to content

Change image src to a local image using javascript?

First time ever touching javascript here, so bear with me. My file structure looks like so: I want to change the image in my HTML using js. Here’s the relevant HTML code: And then the corresponding js code in assignment_3.js: Obviously, something is amiss here, as the browser doesn’t seem to recog…

socket.io broadcast in a room

I am trying to use socket.io to broadcast only to users of a specific room (in another word, to send to all users in that room except me, the sender). So far, I have tried: None of them work unfortunately. Answer io.of(“/”).to(room_temp).emit(‘transcription’, data); would submit to eve…

Window.location not working in Javascript

So I’m new to JS, and I wanna redirect the user to another page… My code: I know this is not a secure way to auth, but relax it’s just a portfolio project Answer You should append the ‘//’ after window.location.protocol which mentioned by @Vasan. Using ES6 template strings would …

Using Ag-grid with object of nested objects

I am trying to use ag-grid with an api that gives the following code And my ag-grid is set up in the following way So far that is giving me an error. I am not understanding why, because the code is working fine when I use a different api. The other api returns the following And my working grid is