誰能幫我出這個問題,我的JavaScript有一個Ajax GET HTTP請求:用ajax請求和Python的交互谷歌應用程序引擎
$.ajax({
url:"/testPage",
type:'GET',
success: function(){
alert("done");
}
});
服務器端Python應用程序有一個處理程序來處理HTTP請求從JS:
class testPageHandler(webapp.RequestHandler):
def get(self):
path=os.path.join(os.path.dirname(_file_).'page1.html')
template_values={}
self.response.out.write(template.render(path,template_values))
def post(self):
.....
application=webapp.WSGIApplication([('/testPage',testPageHandler),
.....
在「得到」的方法,我想Django模板「page1.html」被渲染,所以瀏覽器顯示「page1.html」頁面,而不是僅僅彈出「完成」。 有什麼想法?提前致謝。
這是一個陳述,而不是一個問題。 – 2012-03-01 01:04:25
對不起,我正在編輯這個問題,你只是早一點。 – cnherald 2012-03-01 01:24:56
重複的http://stackoverflow.com/questions/3430877/how-do-i-redirect-a-page-jquery – 2012-03-01 01:28:43