Skip to content

Category: Questions

Double question javascript functions with arrays

This is a double question because I can just post once every 90 minutes. First I have to write a function that replaces a character of a string. And puts a space in place of the chosen character. I tried this but is not working. It returns just the same string. And the second thing is that I have to

Returning [object Promise] instead of actual value

I am new to promises as I am trying to get some objects to show there actual values on a webpage. Instead I am just getting a bunch of [object Promise] instead This is the code I have so far: What I tried I tried reading the firefox promise.resolve method as that seems like what I was looking for: https://dev…

API: Ajax post in Laravel – 403 (Forbidden)

I’m getting 403 forbidden during ajax call. This is happen only if the ajax is on app.js. If I remove from app.js and put to index.blade.php, is working perfectly. How can I make it working also on my app.js? I’ve searched a lot, and found I needed to add this $.ajaxSetup({ headers: { ‘X-CSR…

Difference between two Objects – reduce

I’ve 2 Objects with data that is repeated but also varies. How to compare them and get the differences? I’ve to use .reduce. My work: but the output is without surname: “kowalski”. Expected output: Answer Please use this code

SVG: how to draw multiple semicircles (arcs) path

Using the answer from this thread I was able to draw a semicircle (arc): What I’m trying to achieve is to be able to draw an SVG as a path consistent with many arcs (semicircles) and be able to set fill on them. Something like this: Is there a better way to achieve a simpler path? For now, it looks

Masonary image not positioning correctly on ajax call

I am using https://masonry.desandro.com/ v4.2.2 and the minimal code looks like: And, I have initalized it as : Upto this point its fine, now on click load more, I am making an ajax call and on success it is returning html as: and my ajax success: But, with this code the image are not aligned to correct posit…

Remove 1 element from Embed object DiscordJS

I have been trying to code a bot that copies 1 embed from 1 channel to another channel. But what I want it to do before posting it to the other channel, I want it to remove 1 element from the embed object. How I have it currently: As you can see i straight use message.embeds[0]. So i don’t even

Enter key press on with Vue3

Have this code: I handle the focus perfectly, but want to run the method goToSlug() on key enter be pressed. It doesn’t fire the method. Answer Key presses are only registered on items that have focus. In order to make an element like a <li> tag focusable (which natively does not have that ability…