flask获取从ajax 传过来的参数值,这样写对吗?
flask:
@app.route('/hello', methods=['GET', 'POST']) # 路由
def test_post():
a=request.form
return a
js:
$(document).ready(function(){
$("#name").keyup(function(){
var a = $('#name1').value;
$.get("/hello",a,function(data){
$('#info').html(data)
result = data
})
});
})