I have a JS file having contents: function rejectIfNotSuccess(response) {} usernameChanged(event) {} for example, and I want to include this file in my velocity template in order to do things the same way we do in an HTML file. For example, I want to call a function defined in this JS file in velocity using &…
Category: Questions
the layout of the page does not change with js
Basically I have written a basic code but cannot figure out where is the issue causing it not to work. so I have the following DOM snippet and my script is working as following I have taken container by is and not the body because i have the header and the footer in the page that i would like to
Javascript: Update inner html when URL changes
I have a dropdown menu with anchor links for my page. I want to change the button contents to reflect which anchor it is currently on. To do this I wrote a function that is executed when the button is clicked. It then goes through the array of anchor names and if it matches the array item to the current
React app not loading; whitescreen with no errors
Hoping someone can help me as I am at my wits end trying to figure out why this isn’t loading. The site compiles with no errors but then just hangs loading and whitescreen; nothing in the DOM either to point out what is wrong. Here is the source code (https://github.com/Asutherland8219/react-portfolio) …
detecting pointermove event outside div while pointer is down
I was testing my skills the other day. The ultimate goal is to replace all html tags with div Goal: create a color picker like the one in photoshop Requirements: use H5, JS, and CSS only (I also use ReactJS for building the structure) Already achieved: use onPointerMove and onPointerDown to detect the pointer…
How to declare CSS values with fallbacks when a value is unsupported
I want to use in chrome, but in firefox. if I declare only the overlay value, then firefox would not scroll at all. I know that overlay is not standard but this shall be perfectly irrelevant for now. my question is, which is the best way to have each browser the value as described. is it possible to have a
how to hide a component on specific routes in react.js
I want to hide my navbar when the route is at some specific routes, I want the logic for hiding the nav be in the app.js:- Answer As noted regarding the error you mentioned in comments, it’s caused by the BrowerRouter as its being used in the same file. Solution: Moving BrowserRouter one level up will s…
Node js shared variables and multiple users and multiple entry-points
I have an node-js application that I’m switching from a single-tenant database to a multi-tenant database. The application code is called from an express api but there are also services that run through a different entrypoints, so req.session is not always available. Currently I have database function c…
PermissionOverwrites doesn’t have function edit/create in discord.js?
I was following a page on the discord.js website, but after copying exactly what it says, I get an error: TypeError: message.channel.permissionOverwrites.create is not a function message.channel….
How can a textarea display different content than shown in the console using Custom Component?
I have been playing with a Custom Web Component and have stumbled upon a curious effect I have not seen before and cannot solve the issue. The web-component takes user clicks ( on either alpha chars, …