i trying create reply to comments in my project, and I have some problems with adding comments to reducer, i am trying to add an reply without reloading the page. My comments looks at: It’s my reducer, now i trying write to console: I can’t think of how I can iterate through my array to add a comm…
Category: Questions
Show json result in Textbox ASP.Net
I want to know that how can I get the following json result in textbox instead console.log in asp.net C# ? Thx everyone Answer Try this: you can have: Sometimes your js code could be executed before the rendering of the asp.net page has been completed, so it is better to add the js to the end of the body,
Calculate the percentage of an object property
I have an object, where i want to calculate the percentage and display in the maps, currently the data i am getting is a raw data in an object. Here is the object that i am receiving from backend Based on the object i want the percentage to be calculated and replaced in the respective key/value pair. It will …
Problem retrieving information from the page and submitting it to the JavaScript object constructor
I wanted to create a simple form on the page with a few inputs and button and by receiving information from the inputs. I try to put the person’s information on the screen, but the web page does not display the information well, but only shows [object Object]. Answer demo is basically a Object, which yo…
Zoom on Scroll Down & Scroll up the zoomed element when scale is more than full screen
I tried to make zoom in Zoom out on scroll. The element is zooming on scrolling but I want to make it(the zoomed element) go up once it reached the full width of the screen. Here’s my code: Fiddle: https://jsfiddle.net/mayureshpitale/6etpn0vs/3/ I am trying to make something like this: http://truegossip…
JS event listeners stop working during item drag, only fire after pointerup and subsequent mousemove
I am having trouble getting event listeners to fire when the actual event occurs. I have created a drag-and-drop system that sets a variable hoveringOverTarget = true on pointerover of the target, listens for pointerdown on an image, and then calls a function on pointerup to check if it’s been released …
How does one reduce and mutate/change string entries of an array based on common substring patterns?
I have an array of string items … … and I want to achieve a result like the one below … Any help is really appreciated. Answer Firstly one needs to separate the day value from the hours value part of a single opening hours string. This either can be achieved via indexOf, substring and trim &…
How to retrieve data from a Firestore database
I am doing a project in React, where after I type a value and then click on search button, the app searches if the id exists in the database. If so, it displays the result of the search in the same page. I am having trouble assigning the value of the search and then displaying it. When I try to
How do i use fetch with a result from a fetch in the same function with sync await
the promise creates an array like this, taken from the console: which cannot be used. the code is this: at the point, the list is returned (when the useData function is used) the mapping seems to have not finished. So it returns “promise” instead of the list it should. The aim is to combine the ob…
Overriding super method in TypeScript
I’m trying to overload/override a class method in TypeScript, where the superior method takes zero arguments and the subordinate method takes one. My TypeScript code is similar to the following: This code produces the following error: Why doesn’t this work? It it because the transpiled JavaScript …