我在Google App Engine python代码中有这个,
class ABC(db.Model):
StringA = db.StringProperty()
StringB = db.StringProperty(multiline=True)
abcs = ABC.all()
template_values = {'abcs': abcs,}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
Run Code Online (Sandbox Code Playgroud)
这在index.html中,
<script type="text/javascript">
var string_A = [];
var string_B = [];
{% for abc in abcs %}
string_A.push("{{ abc.StringA }}");
string_B.push("{{ abc.StringB }}"); //This doesn't work?
{% endfor %}
</script>
Run Code Online (Sandbox Code Playgroud)
我的问题是如何将多线推送到数组?
提前致谢.