I am trying to get the current screen orientation of iOS however my function which work on chrome dev tool emulator and desktop but it doesn’t work on iOS. Here is my function: and here is how my program rougthly do to detect the screen orientation change and to use the function: I tried using window.sc…
Vue 3 Composition API: using props as initial value for component data
So I am building a search page in Vue 3 using the composition API. I have a component which takes a set of data from the parent and shows a snippet of the data including where the keyword is, and so it needs to make a working copy of this data to make a displayable value. I had a lot
Uncaught SyntaxError: unexpected token: string literal in javascript. I can’t figure out what’s wrong [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…
How can I repeatedly change the background style of a div using a click event in Javascript?
I am trying to change the background property of each day on a calendar, when clicked, between blue and green using javascript and CSS. like a toggle function. The default color is blue, and I’ve managed to get each day to turn green when clicked but I can’t figure out how to change them back to b…
Create and assign role Discord.js
I’m creating a Discord bot with discord.js, but I don’t find how to create a role and assign it automatically. Example, a client writes: ?insc NAME @pseudo1 @pseudo2 @pseudo3 This command create the role NAME, then a category with channelVoice and channelText with access only for NAME. For the mom…
Filter children in nested object
I have an object which I’m trying to filter out elements with a path and map, but I can’t get past the first level into the nested children. My object (with UI components removed): This filters the elements with a path, but only to the first level: Result: My goal is to have a list of routes with …
CryptoJS decrypted value differ from the original value
I am trying to encrypt some strings and decrypt it with the use of CryptoJS (AES-256). My javascript code: My setup: fefe3124bdc21e8a1c1b3fdfb84c79950b394b8f86fd49dddb616037b1bc2474 (key) a (Input) Qw== (Encrypted string) d5 (decrypted value) May I know which part of my code logic is wrong ? Answer Alright, I…
Undefined error even though variable is declared
I am trying to create a card where all information are stored. However after I created the variable and tried to append text to it, I got an undefined error. What should I change? Here’s the error: Uncaught TypeError: title is undefined createCards http://localhost/Projects/diary/:86 createCards http://…
How to make external javascript file work in ReactJs?
In a React project, my public.html file looks like this: All the components of the project load inside the “root” div. The “function.js” file is an external javascript file from a theme. In one of the React components, I have an input field: Now, inside “componentDidMount()”…
JAVASCRIPT JSON.parse() return Unexpected end of JSON input
I have a response from a service, using https I need parse this response but… I know the final result should be(I get this with postman)… When I run JSON.parse(data) I get this errror “errorType”: “SyntaxError”, “errorMessage”: “Unexpected end of JSON inpu…