Created
January 27, 2018 13:50
-
-
Save MiKolka7/f1c74f44a4876b818dad59c7c2869c88 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/retiqos
This file contains 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
<!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