Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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");
  }
});
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda