[英]Passing data from Javascript back to Python
I am working on webapp2 python framework and wanted to pass data from the javascript back to python. 我正在研究webapp2 python框架,并希望将数据从javascript传递回python。 I have dropdown and every time i trigger the change event, i want the value to be captured and query to be executed with the selected value.
我有下拉菜单,每次触发更改事件时,我都希望捕获该值并使用所选值执行查询。
test='';
js_code_week_selected ='''<script type="text/javascript">
var selected='';
selected = $('#selectedlist').text();alert(selected);
$('#selectedlist').change(function () {
var firstDropVal = $('#selectedlist').val();
'''+test+''' = firstDropVal;
alert(firstDropVal);
});
</script> '''
self.response.out.write(js_code_week_selected)
logging.info(test);
Cross Origin support is required 需要跨源支持
Have a look into enable-cors.org and you can test virtually at http://client.cors-api.appspot.com/client 查看enable-cors.org ,您可以在http://client.cors-api.appspot.com/client上进行虚拟测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.