I am using Google App Engine to develop an application, and I want to use an AJAX call to execute Python script. I can retrieve the script, but I cannot execute it.
I would use WSGI, as suggested here: How do you execute a server-side Python script using jQuery?. However, I do not want my page to redirect, and my solution to keeping to page from redirecting was to use an AJAX call as suggested here: Run CGI application without redirecting from HTML, and here: Make a tag act like input button.
Right now I use an HTML form but I want to stop it from redirecting the page.
<form action="/token" method="post" >
<div> "some button code" </div>
</form>
So I have been trying to use AJAX instead, but it returns the code without executing it
$.post('js/mailToken.py', { testdata: 'hello world' },alert("success"));