在self.method()中有一个http调用,在某些情况下它只在响应链接中返回。我想使用这个输出来处理另一个方法中的异常,如 print "The object is not present"else:我会犯这样的错误
AttributeError: 'Response' object has no attribute '
我只是不能在if/else语句中使用ajax调用的响应。如果我在console.log()中输出响应,就会显示它被正确设置,但是简单的if/else语句就不起作用了。if (foo=="ok") { // should be true, but isn't
console.log('foo='+foo+' -> OK'