Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!