Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

272
Vistas
Why doesnt my website sub url working when submitting form but works when i manually enter it

I have a form on localhost:8080 which when you enter form data (user & pass), then press submit, it meant to send a POST to localhost:8080/submit, then should show text on that page saying "Submit page". When I enter "localhost:8080/submit" into my browser, it works, but when I use the submit button to get there, it says "This site can’t provide a secure connection" (aka, doesn't work)

script.js

const url = "https://localhost:8080";
const data = {
    "user": "user",
    "pass": "pass"
}

function send() {
    alert("Sent")
    $.post(url, data, function (data, status) {
        console.log("Sent " + data + ", status is: " + status)
    });
}
body {
    background-color: #444444;
}

.form-div {
    width: 100%;
    height: auto;
    text-align: center;
    justify-content: center;
    align-content: center;
    border: 1px solid red;
}

form {
    color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Harley Swift</title>
    <link rel='stylesheet' href='styles.css'/>
    <script type="text/javascript" src="script.js"></script>
</head>

<body>
<div class="form-div">
    <form method="POST" action="https://localhost:8080/submit">
        <div>
            <label for="user">Username</label>
            <input name="user" type="text" id="user"><br>
        </div>

        <div>
            <label for="pass">Password</label>
            <input name="pass" type="password" id="pass"><br>
        </div>
        <br>
        <div>
            <button class="btn" onclick="send()">Submit</button>
        </div>
    </form>
</div>
</body>
</html>

app.js: https://hastebin.com/udunalurub.lua (couldn't figure out how to use code snippets on here, sorry)

Thank you in advance! I am not too familiar with nodejs servers yet

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Don't use https, use http when developing locally.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda