最佳答案
我不确定你是否正在使用JQuery,但你应该使用AJAX来调用python api.
原文链接:/python/439585.htmlJquery方法:
http://api.jquery.com/jQuery.ajax/
$.ajax({
type: "POST",//OR GET
url: yourapiurl,data: datatosend,success: success,//Callback when request is successful that contains the sqlite data
dataType: dataType
});
Javascript方法:
http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST",yourapiurl,true);
xmlhttp.send();