Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--suppress ALL -->
- <html>
- <head>
- <title></title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- </head>
- <body>
- <ul id="info"></ul>
- <script type="text/javascript">
- var $list = $('#info');
- $(function () {
- $.ajax({
- type: 'GET',
- dataType: 'json',
- url: 'info.json',
- success: function (datas) {
- $.each(datas, function (i, data) {
- $list.append( '<li>'+ data.name +'</li>');
- console.log(data.age);
- })
- }
- });
- })
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement