重複の可能性:
JSON を Python CGI にポストする
Apache2 がインストールされ、Python が動作しています。
私は問題を抱えています。2ページあります。
1 つは Python ページで、もう 1 つは JQuery を使用した Html ページで、Src を Google jquery リンクに貼り付けることができませんでした。
誰かが私のajax投稿を正しく機能させる方法を教えてください。
$(function()
{
alert('Im going to start processing');
$.ajax({
url: "saveList.py",
type: "post",
data: {'param':{"hello":"world"}},
dataType: "application/json",
success : function(response)
{
alert(response);
}
});
});
そしてPythonコード
import sys
import json
def index(req):
result = {'success':'true','message':'The Command Completed Successfully'};
data = sys.stdin.read();
myjson = json.loads(data);
return str(myjson);