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

104
Visualizações
Outdated, broken AJAX request

Recently migrated files over, and updated ca.py to run in Python3 instead of Python2. I have this AJAX request and JavaScript alerts work right before it, but not after. There are no console or other errors, so I'm not sure what exactly is wrong. Code below:

alert(input);
      var request = $.ajax({
      url: "ca.py",
      type: "GET",
      data: {rule: ruleNumber, numSteps: numRows, inputVector: input},
      dataType: "html",
    });
    
    alert("request opened!");

The first alert of the input shows without issue. The second alert showing "request opened!" does not. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

This snippet demonstrates that your code basically works - even if the given url does not return anything:

// define some constants:
const input=123,ruleNumber=7,numRows=5;

alert(input);
  var request = $.ajax({
  url: "https://jsonplaceholder.typicode.com/users", // "ca.py",
  type: "GET",
  data: {id:7,rule: ruleNumber, numSteps: numRows, inputVector: input},
  dataType: "html"
});
alert("request opened!");
// further down:
request.done(function(dat){alert("received:\n"+dat)});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

And in case the url actually returns something then the .done() will also fire.

about 4 years ago · Juan Pablo Isaza Relatório

0

Welp, it was one of those "oh my god" type of issues. Thanks to those who posted here - you helped me get much further in my debugging than I did on my own.

The issue is that my hosting platform needs a specifier for Python3. I received the following message back:

The following python binaries are available:

python3: Python 3.9.7 python3.8: Python 3.8.12 python3.9: Python 3.9.7

Please use the binary for the version of Python you want.

So, I changed my env from python to python3, and we're all set!

about 4 years ago · Juan Pablo Isaza 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