I have a html form and I want to create a json-file with data introduced in html fields. Right now, it is visible in console json-text but it doesn’t create a new json-file with this content. Also,I have an error, Uncaught ReferenceError: require is not defined. Answer It seems you are on the frontend. You can’t write files like this
Tag: html
Variable coming up as undefined when called outside of a function, but working when called inside the function
I have a function that creates an html dom modal window with a textbox and a button that closes it. When the close button is clicked, the value of the textbox is stored in a variable. The variable (as far as I know) is global, and is not limited to inside the modal window function. I have it set up
Change script “src” by URL param and make it functional
I am thinking if it’s possible for doing this on a static website, I have the link of and the main HTML is Now, I wanna make it to update according to the URL Param, I’ve got a URL Param (and update the code above) by The txt files are in the format of However, the trouble I’m having is
I want to paginate data. It is working fine but when I search for specific data it always shows in the first page
What I want is to paginate my data but the problem is when I’m searching for specific data if I’m on page 3 the result shows on page 1 always and I can’t see anything because I was on page no 3. I want to go to page 1 automatically when I’m searching for something. Also when I press the
Console log returning empty value when calling for input field variable
Why is console.log returning an empty line when calling for a text input’s variable. HTML Javascript I tried the actual form and its console.log worked perfectly on submit, but somehow the value for ticketSubject seems to be empty. Here’s the subject field: But it returns nothing: Answer You’re reading the value of the input immediately when the page first loads,
HTML canvas not producing image from web cam
I want to capture image every time socket.on(‘takePic’) gets triggered. It works fine for the first time. but when the socket.on(‘takePic’) gets triggered second time,the canvas div is just blank and so the img tag. I have copied the takePicture() function from somewhere and added the setInterval() and localstream variable to stop camera. how can I fix this? here is
I had to use a for loop to to go through each character in a string but the code is not working properly
These are the instruction for the exercise I am supposed to do: Start with a prompt that asks the user to enter any string. Using a for loop, go through each character in the string. If the string contains the letter A (capital or lowercase), break out of the loop and print the message below to the screen. If the
Multiple Slideshow not working properly. Any Clue?
So basically, I’m trying to create multiple slideshows on the page with dots to switch between the slides (because I’ve already tried the arrow type button and it doesn’t workout for me idk), and the issue is that when I use more than one slideshow the dots on the first one either stop working or begin switching the below slideshows
Modal not opening when I click on button
I am trying to display data in the Modal when I click the button. This is the HTML code I wrote everything is looking fine but it won’t open the Modal when I click the button. If I put an alert inside the script it popup when I click the button but anything else like the modal is not working.
Breaking a div without content into a new line (no text)
I am taking typed characters from input and depending what it is styling them differently and rendering in a container with different colour and shape. This what I am trying to achieve is when user types a space in the input, the line breaks, so you have 2 divs in one line, 7 divs in second line and 5 divs