Javascript html页面上的formpost方法
我试图在google app engine的html页面中使用Form post方法或ajax post方法,但似乎什么也没发生Javascript html页面上的formpost方法,javascript,python,html,ajax,google-app-engine,Javascript,Python,Html,Ajax,Google App Engine,我试图在google app engine的html页面中使用Form post方法或ajax post方法,但似乎什么也没发生 class Email(webapp2.RequestHandler): def post(self): ''' Post method to handle Email requests. ''' print self.request self.response.write(
class Email(webapp2.RequestHandler):
def post(self):
'''
Post method to handle Email requests.
'''
print self.request
self.response.write(self.request)
app = webapp2.WSGIApplication([('/', MainPage),("/email",Email)],
debug=True)
<form method="post" action="http://localhost:8080/email" >
<p>
<label for="byour_name">Your name</label><input type="text" name="byour_name" value="" id="byour_name">
</p>
<p>
<label for="byour_email_address">Your email address</label><input type="text" name="byour_email_address" value="" id="byour_email_address">
</p>
<p>
What's on your mind?<br>
<textarea name="Message" rows="10" cols="25">
</textarea>
</p>
<p>
<input type="submit" value="Send it!">
</p>
class电子邮件(webapp2.RequestHandler):
def post(自我):
'''
处理电子邮件请求的Post方法。
'''
打印自我请求
self.response.write(self.request)
app=webapp2.WSGIApplication([(“/”,主页),(“/email”,email)],
debug=True)
你的名字
你的电子邮件地址
你在想什么?
我也尝试了wireshark来检查网络活动,但什么也没发生。我发现了我的问题。我必须删除我之前使用的下面提到的行
$("form").bind("submit",function(event){
event.preventDefault();
只要我把它取下来。它工作了..但是如果我在app.py文件中声明为,那么它工作了。但是,如果我试图从index.html中声明的表单发布,它不起作用。您是否尝试使用相对路径而不是绝对路径?两者都有,但什么都没有发生……我认为wireshark无法显示本地主机流量,只能显示真实网络接口上的流量。是的,如果使用环回接口,您可以看到本地主机流量。。