Im trying to import useHistory from react-router-dom but it keeps giving me the error ‘react-router-dom’ does not contain an export named ‘useHistory’. React-router-dom’s version is 4.3.1 and i’ve tried updating (in case there was an updated version) but every time i do npm…
Is it possible to dynamically change the color of a dropdown or change list item color when a radio option is selected in Javascript/JQuery?
I have code that allows me to select a radio option, say, ‘Work’, and have the dropdown box automatically select ‘Work’ in response. But is it possible to go further and to select the radio option ‘Work’, and have the ‘Work’ dropdown be selected and also change …
Javascript, remove jQuery call
I have a file.js like this: My question is (I’m not sure how jQuery works at this) What is doing the last if statement? My idea is to convert that all function in a React util like And to use its methods and values, but I don’t understand what it is doing that last part that I said. Any help
WIX Velo – Extracting Domain from User Email – Regex Issue
I am trying to retrieve the domain of my site users in order to assign them specific organisation based privileges. If their email address is email@example.com, I want to extract example. If it’s email@ex.ample.com I want to extract ex.ample The regex I have is (?<=@)[^.].[^.](?=.) But I’m stru…
Update events in calendar after change in variable – Fullcalendar
Using Fullcalendar with Vue.js, I’m passing the initial events from a variable, but I need that after this variable is updated, the events were updated in the calendar also. The documentation seems to be clear about that: But I’ve tried this and nothing happens, the events keeps as the first rende…
Using a for-loop to retrieve elements from an Array
I’m new to JS and keep running into issues for a recent class assignment. I’ve reached out to my professor for help but I’m still not understanding it. For our assignment, I need to use a for-loop to retrieve elements from my beatlesArray and concatenate them into a string variable with this format if the ima…
Trying to create javascript function to search text file and return key pairing
So lets say I have a file called fruit.txt that contains the following data in this format: I want to create a javacript function called fruitcolor that takes the name of the fruit as its only parameter, searches the fruit.txt file and returns the corresponding color of the fruit, if no fruit is found return …
How to make to drawing a SVG with D3.js?
I’m trying to draw a map in an SVG with the GEOJSON data that I bring from this API, the SVG paths are filled with the data, however, the SVG is blank, as can be seen when executing the code below. Notice the document.write, the data is returned correctly. I tested it with another GEOJSON file, and mana…
Trying to remove attribute from HTML using JS
Ive made a quiz app, with HTML and JS only and im trying to remove an id from a element which has the attribute, however when i run the code to remove it my JS doesnt find the attribute in any of the elements, if i manually inspect i can see it in the html? i do add this element
Problem with repeated objects while importing JSON into Google BigQuery
I have been trying to manually upload the JSON into BigQuery, but I get the following error message. I already converted the file into newline delimited JSON, so that is not the problem. When looking at the custom_field.value from the error I get this: The problem seems to be that the custom_fields.value has …