Skip to content
Advertisement

Tag: javascript

Fetched Object from API doesn’t appear in mapping

I call a get request to my api, and then register them to my state with this: I even tried the axios approach: If I console.log posts_data and posts, it gives me the Object I got from my api: But whenever I iterate and display it: It doesn’t show up on the page. I even tried adding that random string

Create smooth scrolling effect

I have a code to scroll content horizontally, it works but whenever it scrolls, it scrolls items one by on like breaking, so I want it to scroll smoothly, that is the sample code below, please I need help with it Answer Maybe you can try scroll-behavior: smooth in your css file. Here is an example. Or, if you want

Sort array based on values in another array

I have 2 arrays as follows. Array 1 And the next array Array 2 I want to sort the array1 according to the data order in array2. I have tried something like this but it’s giving me a undefined result Can someone help me with this? Answer

Force load JS script on page

I have a third party JS script with class Oreole defined there. This script is located on a CDN server elsewhere. I have this reference in my HTML: Later in my page script code I have Sometimes the CDN fails with 504 or 502 and my code crashes. Usually, page reload helps. But how do I force script reload on

How to move the image to bottom?

how do I make so that my image is on the bottom on any screen size and I also want my to be under the feet of the human so that you must scroll down to see the now it is like this and I want it to be like this on all sreen size heights my code to the

Error: The type property must be definedn in mapbox-gl-js

I have problem in adding source to map. ./temp-data With the above code i am getting this error. If i change to then i am not getting any error. addSource takes an object and id. I am passing id as the first parameter and object as the second parameter. Then why this error is appearing. Answer Your error is because

Advertisement