我对 AngularJS 很陌生。 我正在编写一个代码,根据 python 文件的输出,angularjs 文件应该有不同的 react 。 我不断收到此特定错误
angular.js:10765 GET http://harsha.seq-technology.in/ajax/duplicate_check.py?q=0 500 (Internal Server Error)
我做错了什么? 我的脚本文件如下:
$scope.save_me = function () {
$scope.dup_yes=1;
console.log("here");
$http.get("/ajax/duplicate_check.py",{params{"q":0}}).then(function(response) {
console.log("here2");
console.log(response.data);
if (response.data['login_status'] == 1 ){
console.log("Mission is a Success\n");
}
})
}
我的 python 文件给出的输出如下:
Content-Type: application/json
{"login_status": 1}
非常感谢您的帮助。
最佳答案
这与 angularjs 无关,首先确保你的“脚本”返回正确的 HTTP 响应,结果代码为 200。
在执行其他操作之前,您可以使用 curl
或 wget
来调试结果。
关于python - 无法使用 angularjs 调用 python 文件输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37342874/