我的Ajax代码:如何将消息返回给ajax?
$.ajax({
type: 'POST',
url: URL + "xyz/" ,
data: {"email": email},
success: function(data) {
alert('hello')
},
dataType: "json",
});
我在Python +一瓶架构处理器:
def index():
if request.POST == XMLHttpRequest:
email = request.GET.get('email')
response.COOKIES['email'] = email
if check_email(email): //a method written for checking email
return some template
else:
return False //here i want to return some error message to ajax. How to
办呢?以及如何抓住ajax中的错误。
抛出错误:NameError(“全局名称'XMLHttpRequest'未定义”,) 是瓶支持吗?
你是从哪里复制的?大多数Pythons行没有任何意义... – 2010-11-30 20:43:15