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

158
Views
Url that have been passed to long

Im writing this code for save an url in a file txt, that i will use too pass after the same for invoke the button share. my problem come when i use this code

$.ajax({
  url: "/condividi.php",
  dataType: "json",
  data: {
    res: osrm_result
  },
  success: function(data, textStatus, jqXHR) {
    alert("ciaociao");
    window.open("https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F52.16.81.189%2Findex_gen.html&src=sdkpreparse");
  }
});

this trigger the error: Url too long how i can correct this to make it work

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

the default method which jQuery uses is GET which has limited data length, try sending the data by POST (you should of course update the condividi.php accordingly to serve the POST request):

$.ajax({
  type: "POST",
  url: "/condividi.php",
  dataType: "json",
  data: {
    res: osrm_result
  },
  success: function(data, textStatus, jqXHR) {
    alert("ciaociao");
    window.open("https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F52.16.81.189%2Findex_gen.html&src=sdkpreparse");
  }
});
about 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!