Created
November 27, 2017 18:29
-
-
Save EdMan1022/6e03cadea92b621561ea4af3c0ef2535 to your computer and use it in GitHub Desktop.
Ajax trouble
This file contains hidden or 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
| {% extends 'utilities/base.html' %} | |
| {% block title %}{{ analysis_group.name }}{% endblock %} | |
| {% block content %} | |
| <div class="row justify-content-center"> | |
| <div class="col-8"> | |
| <div class="card border-primary mb-3"> | |
| <div class="card-header"> | |
| <h3>{{ analysis_group.name }}</h3> | |
| <h4>{{ analysis_group.description }}</h4> | |
| </div> | |
| <div class="card-body"> | |
| <ul class="list-group list-group-flush"> | |
| <li class="list-group-item"><b>Questions:</b> | |
| <ul class="list-group"> | |
| {% for question in analysis_group.question %} | |
| <li class="list-group-item">{{ question }}</li> | |
| {% endfor %} | |
| </ul> | |
| </li> | |
| <li class="list-group-item"><b>Description:</b> | |
| <p class="card-text">{{ analysis_group.comment }}</p></li> | |
| </ul> | |
| </div> | |
| </div> | |
| <a href="{{ url_for('survey_operations.upload_responses', survey_id=survey.id) }}" | |
| class="btn btn-primary">Add Analytic</a> | |
| </div> | |
| </div> | |
| {% for analytic in analysis_group.analytic %} | |
| <div class="row justify-content-center"> | |
| {% include analytic.analytic_type.template %} | |
| </div> | |
| {% endfor %} | |
| {% endblock %} | |
| {% block js %} | |
| <script type="text/javascript"> | |
| var csrf_token = "{{ csrf_token() }}"; | |
| $.ajaxSetup({ | |
| beforeSend: function (xhr, settings) { | |
| if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) { | |
| xhr.setRequestHeader("X-CSRFToken", csrf_token); | |
| } | |
| }; | |
| $.ajax({ | |
| type: "GET", | |
| url: "{{ url_for('analytics.cluster_analysis_view') }}?analytic_id=1", | |
| success: function (data) { | |
| $("#ajaxTest").html(data) | |
| } | |
| }); | |
| </script> | |
| {% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment