mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
stuff working
This commit is contained in:
@@ -29,4 +29,22 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function openRecipe(id) {
|
||||
url = "{% url 'get_file_link' recipe_id=12345 %}".replace(/12345/, id);
|
||||
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function () {
|
||||
if (this.readyState === 4 && this.status === 200) {
|
||||
console.log(this.response);
|
||||
window.open(this.responseText, '_blank');
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user