Created
February 23, 2017 02:49
-
-
Save agnaite/b2674511acc5bd2745fa7f2005ebc843 to your computer and use it in GitHub Desktop.
jinja loops in js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<h2>Temples</h2> | |
<div></div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
{% for temple in temples %} | |
$("div").append("{{temple.temple_name}}<br/>"); //append each temple name to div tag | |
var longt = parseInt("{{temple.long}}"); //get each longtitude and save as an int | |
var lat = parseInt("{{temple.long}}"); //get each latitude and save as an int | |
{% endfor %} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment