मैं गूगल एप इंजन अजगर कोड में इस राशि बहु,GAE + जावास्क्रिप्ट धक्का: पुश करने के लिए
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))
और इस 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>
मेरा प्रश्न है कि कैसे करने के लिए मैं multiline सरणी को धक्का ??
अग्रिम धन्यवाद।
मल्टीलाइन जावास्क्रिप्ट पर थोड़ा सा मुश्किल है, स्ट्रिंग_B में '\ n' के साथ '\ n' को बदलना चाहिए। – systempuntoout
केवल प्रतिस्थापित करने से \ n न्यूलाइन के लिए समस्या हल करेगा, लेकिन यह अन्य पात्रों (उदा। कोटायन अंक), और एक संभावित एक्सएसएस भेद्यता छोड़ देगा। – ehabkost