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.
2
Answers
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:
So, I changed my env from python to python3, and we're all set!
This snippet demonstrates that your code basically works – even if the given
url
does not return anything:And in case the
url
actually returns something then the.done()
will also fire.