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

390
Vistas
ajax POST, trying to add the directory link adds the path twice
            $.ajax({
                type: "POST",
                url: "/bbr-category-configuration",
                data: "category_data",
                dataType: "json",
                success: function (response){
                    console.log(response);
                }
            });

im testing out my ajax form in a console.log

1

it says 404 not found but I thought alright sure, I missed the full path so I added:

url: "clinical/bbr-category-configuration",

This time, the path goes through my clinical folder twice as seen in the next screenshot

2

How is this happening? (the directory getting added twice)

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

What you are defining are absolute and relative path of the url.

In JS or html file, if you redirect/request to any url with the /urlPath then your redirect/request will be from the base url(http://example.com/urlPath) onwards.

You can see this behaviour with simple anchor element. Just put these in the html file and you will see the result

<a href="clinical/bbr-category-configuration">Redirects from the current path</a>

<a href="/clinical/bbr-category-configuration">Redirects from the base url path</a>

The above clinical/bbr-category-configuration will redirect/request from your current url. if you are on https://example.com/url/url2 then you will go to https://example.com/url/clinical/bbr-category-configuration

So In your case you should use /clinical/bbr-category-configuration as mentioned by @Aless55

over 4 years ago · Santiago Trujillo 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