All Questions
3,060
questions
0
votes
1
answer
57
views
How do I set up my POST form submission to stay on the same page and input any errors in a div?
SOLUTION FOUND: SEE BOTTOM FOR UPDATED CODE
I have been trying to get this to work for about 8 hours now. I cannot for the life of me get a script to work for this. I have tried many different scripts ...
0
votes
0
answers
59
views
Why is my AJAX request not working in Node.js and Express project?
I'm trying to make a request using ajax to my backend, but it always returns a 404 error, but my route exists.
Project structure:
public
-scripts
--script.js
routes
-chats.js
views
-chats.ejs
index.js
...
0
votes
1
answer
61
views
nodejs using https to send res back to client
app.post("/weather", function(request,response) {
let city = request.body.city;
const options = {
method: 'GET',
hostname: 'open-weather13.p.rapidapi.com',
...
0
votes
2
answers
701
views
How to get a local file via fetch/axios?
For study reasons I need to use some of these network APIs like fetch or axios but to get a LOCAL file, so WITHOUT using fs module, or WITHOUT importing them.
I tried with both fetch and axios, but ...
1
vote
1
answer
64
views
How to pass data by using an AJAX request to app.post() method in Express?
I develop a blog application using express and node, and I need to pass an array of keywords to the app.post() method to save a blog post (no database is used, an array holds these blog posts) with ...
0
votes
0
answers
31
views
ajax code for retriving data from db is correct still cant display the specific result which is searched for on the page
my project is a todo list website. in which I have added a search page where a task can be searched. task with day date time will be displayed, the code for that seems correct to my knowledge but it ...
0
votes
0
answers
47
views
Application breaks when json file is requested
I have setup a simple express server that serves static files (React app build) like shown below:
import express from 'express'
import path from 'path'
const app = express()
app.use(express.json())
...
0
votes
2
answers
38
views
Jquery serialzed form datas are displayed as string on server side while sending using ajax
I wanted to send 3 objects to my server. 2 payment response objects and one object contains my form input field values. But if i send it together like i shown below, the formData is treated as string ...
1
vote
0
answers
328
views
Nodejs ajax sync calls not working from 2024 january (Chrome)
Premise: I know that "sync" is evil and that nobody should use it. I don't expect answers like "don't use sync" or "rewrite it async". I already know! Thanks.
I have a ...
0
votes
1
answer
65
views
NodeJs fetch with file to Golang API
I try to post via node-fetch to golang API files with some structure, I can make it from postman, but no way from NodeJS
Hi there. im at dead end, i had tried everything...
I need make a request to ...
0
votes
1
answer
22
views
How do I update multiple collections in a specific way when the user clicks a button?
I have two collections:
test.matchhistories (for storing data of previous matches)
test.userdbs (for storing data of players)
I have a page called "live-tracking.ejs"
Here is the table for ...
0
votes
0
answers
28
views
Undefined req.body Values When Sending Form Data via Ajax [duplicate]
I'm using Ajax to send form data to the server, but I'm encountering an issue where I'm getting undefined values when I try to access req.body.name on the server side. However, the file upload part is ...
-1
votes
1
answer
55
views
Updating ejs template with AJAX request
I am creating a web app that returns recipes when a user searches for a specific ingredient(s). I am using the edamam api and decided to use pagination so that I could load more recipes relative to ...
0
votes
1
answer
310
views
req.body not working I can't receive data from POST with express in javascript
This is my first time building an express server in nodeJS, i don't know much of what im doing but i managed to make POSTs and GETs using routes and controllers... I don't know why req.body is showing ...
-1
votes
1
answer
50
views
Ajax 400 error after Express Validator runs server-side validation
I am trying to fix a form handler that always throws a 400 error after middleware validation.
The middleware validation goes like this:
const contactValidate = [
check('name')
.exists()
....