Skip to content

Instantly share code, notes, and snippets.

@MiKolka7
Created January 27, 2018 13:50
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 MiKolka7/f1c74f44a4876b818dad59c7c2869c88 to your computer and use it in GitHub Desktop.
Save MiKolka7/f1c74f44a4876b818dad59c7c2869c88 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/retiqos
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<table class="js-table" border="1"></table>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script>
const API = 'http://stock.ssangyong.pl/api/getHotoffers/index.php';
$.getJSON(API, data => {
const tr = data.map(item => (
`<tr>
<td>${item.params.make}</td>
<td>${item.params.mileage}</td>
<td>${item.params.price.hot_price}</td>
</tr>`
));
$('.js-table').append(tr);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment