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…
Tag: javascript
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…
Django/Js: how to post a form without reloading whole page
My application currently flows through 3 pages: User selects question in index page User submits answer in answer page User is presented with result in results page. I want to compress that down to a single page where the user submits an answer to the question and result is shown on the same page. The followi…
ws.write = (result.join(‘,’) + ‘n’); && TypeError: result.join is not a function …how i solve this type error
help to solve in this javascript problem. Give me clear documentation about (join). } Answer Clear documentation for join Not sure what compareTriplets is but based on the word compare I am assuming it returns a boolean. You are trying to join a boolean expression. If you want one string containing of A and B…
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
Ternary conditions to find expmod?
I am reading SICP in JS about a non-terminating example of ternary conditions: It explains that: This would make the function not just inefficient, but actually non-terminating! The problem is that the constant declaration appears outside the conditional expression, which means that it is executed even when t…
Replace multiple occurrences in String on Google Spreadsheet
So I have a spreadsheet up for the purpose of documenting descriptions of functions found in some python files. TLDR these descriptions are hard to read due to the clutter left over from the files. So my solution to solve this was: But it only works on the first occurrence when I need it to happen multiple ti…
Javascript for loop only giving one output
I’ve been toying with this for far too long… I have no clue why that for loop at the end only sends one GET request. Please, spare me my sanity… I just don’t get it. The array “urls” contains the information I need, and the variable “sendstr” works perfectly wel…
Insert a image in on column in my table in quasar
How can I insert an image on one row of my table? I have tried to put v-if in my loop through the columns but I cannot get it right. I am pretty new to quasar so I might confuse things. My idea was to use the v-if for checking if the column name is ‘Image’ insert an image. And