Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>EXERCICE 3 : JSON </h1>
- <button type ="button" onclick="GenererFichier()">FichierJSON</button>
- <button type ="button" onclick="GenererFichierNuage()">FichierJSON</button>
- <h5 id="ptest4"> </h5>
- <script type="text/javascript">
- function GenererFichier(){
- $.getJSON( "fichier.json", function(data) {
- $('#ptest4').append("<ul>");
- $.each( data.employees, function(i,item) {
- $('#ptest4').append("<li>" + item.firstName + " " +item.lastName+ "</li>");
- });
- $('#ptest4').append("</ul>");
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement