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

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

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 Report

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 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!