Basic AJAX requests and handlebars template for each review. Still static page #4

Merged
andrewlalis merged 7 commits from al/script_basics into develop 2018-09-25 15:18:38 +00:00
2 changed files with 21 additions and 2 deletions
Showing only changes of commit abc5a6f061 - Show all commits

View File

@ -262,10 +262,11 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/vendor/bootstrap.min.js"></script> <script src="js/vendor/bootstrap.min.js"></script>
<script src="js/handlebars-v4.0.12.js"></script>
<script src="js/main.js"></script> <script src="js/main.js"></script>
<script src="js/load_reviews.js"></script>
</body> </body>
</html> </html>

View File

@ -0,0 +1,18 @@
var $ = jQuery;
function displayReviews(reviews) {
}
function loadReviews () {
$.ajax({
url: "http://localhost:8000/api/postings/",
method: "GET"
}).done(function (response) {
displayReviews(response);
}).fail(function (response) {
console.log(response);
})
}
loadReviews();