JQuery로딩 후 호출

SONA·2021년 11월 10일
0

Javascript

목록 보기
7/9

로딩 후 호출

<script>
  $(document).ready(function(){
	alert('로딩') // 확인 후 삭제
  	get_rate();
  });

  function get_rate(){
            $.ajax({
                type: "GET",
                url: "호출url",
                data: {},
                success: function (response) {
                    let now_rate = response['rate'];
                    $('#now-rate').text(now_rate);
                }
            })
        }
</script>

span

<body>
  <span id="now-rate">적용text</span>
</body>

0개의 댓글