Skip to content

Instantly share code, notes, and snippets.

@KowalczykBartek
Created April 25, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KowalczykBartek/4b96e9e0f5a7c60cd7244680228bd004 to your computer and use it in GitHub Desktop.
Save KowalczykBartek/4b96e9e0f5a7c60cd7244680228bd004 to your computer and use it in GitHub Desktop.
$.ajax({
type: 'GET',
url: '/xxoxoxoxoxoxo',
dataType: 'json',
success: function (data) {
$.each(data, function(index, element) {
console.log(element);
var html =`<a href="/${element["mockId"]}" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">mock ${element["mockId"]}</h5>
</div>
<p class="mb-1">method: ${element["method"]} path: ${element["path"]}</p>
<small>Donec id elit non mi porta.</small>
</a>`;
$('#mocks-list').append(html);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment