Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
<input type="text" id="todo-list-item"/>
</label><br/>
<button type="button" id="add-item-button" class="btn btn-success"><span class="glyphicon glyphicon-plus-sign"></span>Add Item</button>
<button id="remove-item-button" class="btn btn-danger"><span class="glyphicon glyphicon-minus-sign"></span>Remove Item(s)</button>
<button id="remove-item-button" class="btn btn-danger"><span class="glyphicon glyphicon-minus-sign glyphicon glyphicon-phone"></span>Remove Item(s)</button>
</form>
<div class="glyphicon glyphicon-phone"></div>
</div>
<br/><br/>
<button id="ajax-button">Run AJAX</button><br/>
<button id="populate-list-button">AJAX Items to List</button>
<button id="ajax-button" class="btn btn-default"><span class="glyphicon glyphicon-fire"></span>Run AJAX</button><br/>
<button id="populate-list-button" class="btn btn-default"><span class="glyphicon glyphicon-fire"></span>AJAX Items to List</button>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
Expand Down
16 changes: 16 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,20 @@ $(document).ready(function() {
}
});
});

var populateUsingAJAX = function() {
$.ajax({
url: 'test.json',
type: "GET",
dataType: "json",
success: function(response) {
for(var i=0; i<response.tasks.length; i++) {
addItemToList(response.tasks[i]);
}
}
})};

populateUsingAJAX();


});