환율 json

카테고리 없음 2018. 4. 18. 21:46 |

환율 참고페이지 http://pureani.tistory.com/4919

 

  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">  
  5. <title></title>  
  6. <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>  
  7.   
  8. <script>  
  9. $(document).ready(function(){  
  10.   
  11.   
  12.   
  13. $.ajax({  
  14.     url:"http://api.manana.kr/exchange/rate/KRW/JPY,KRW,USD.json",  
  15.     dataType: "json",  
  16.     success:function(data){  
  17.        alert(data[2].name);  
  18.        alert(data[2].rate);  
  19.        alert(data[2].date);  
  20.     }  
  21.     ,error: function () { alert("에러발생"); }  
  22. });  
  23.   
  24. });  
  25.   
  26.   
  27. </script>  
  28.   
  29. </head>  
  30. <body>  
  31.   
  32. </body>  
  33. </html>  

: