티스토리 뷰

728x90

@2-1. 전역변수

    <script>
        let count = 1;
        function hey() {
            if (count % 2 == 0) {
                alert('짝짝짝👏');
            } else {
                alert('홀홀홀🎅');
            }
count += 1;
        }
    </script>

 

@2-2. JQuery

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

 

id = article-url  >>> $('#article-url').(val, text) (); 지칭 / hide : 숨김 show : 보임

let temp_html = ` `(자주 씀) // 변수 넣기 : ${내용}

 

includes

: 구별 하기

let domain = txt.split('@')[1].split('.')[0]

: 나누기

$('#names-q3').empty()

empty : 다 지우기

 

@2-3. Ajax

 

$.ajax({
  type: "GET",
  url: "여기에URL을입력",
  data: {},
  success: function(response){
    console.log(response)
  }
})

 

--------------------------------------

jquery img src 변경 :

$("#img-cat").attr('src', imgurl)

.attr('src',imgurl)

728x90
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함