전체 글90 비동기 Async) callback 함수가 또 다른 함수를 부르는 것 Callback() 함수라고 한다 자바스크립트는 function으로 호출된 순서대로 작동한다. first()인 hello string이 출력된다. 이 처럼 , 적은 순서(sequence)대로 출력되는 것이 아니라, 호출되는 함수의 순서대로 출력된다. JavaScript functions are executed in the sequence they are called. Not in the sequence they are defined. 호출 순서를 생각할 떄 , 호출된 함수부터 보고 위로 따라 가자 ->(function mydisplayer or function first() 등등 부터 보지 말고 , second() first() 밑에 있는 호출 함수부터 보고 위로 올라가.. 2023. 2. 11. [Ajax] open() send()로 서버에 데이터 전송 ajax 기술을 사용할 때는, 웹페이지 안에서 바로 서버로 데이터를 전달할 수 있기 하기 위해 XMLHttpRequest()함수를 사용한다. 이때, 서버로 데이터를 전달하는 함수들이 있는데 , 대표적으로 open()과 send()를 들 수 있다. open(method,url) method : 요청의 유형 (GET 또는 POST) url : 서버의 위치 send() send: 서버로 데이터 요청 (GET) function loadDoc(){ const xhttp = new XMLHttpRequest(); xhttp.onload = function(){ document.getElementById("demo").innerHTML = this.responseText; } xhttp.open("GET","ajax.. 2023. 2. 11. [Ajax] .onload() 함수란 무엇일까? https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_first W3Schools online HTML editor The W3Schools online code editor allows you to edit code and view the result in your browser www.w3schools.com The XMLHttpRequest Object Change Content Ajax를 만드는 기본 순서 1.button의 loadDoc() 함수가 움직이기 위한 큰 틀을 만든다. 2.XMLHttpRequest() 함수를 불러서 웹페이지 안에서 서버의 이동이 가능하게 해준다. 3.window의 onload() 함수를 쓴다. 여기서 onload()를.. 2023. 2. 11. [Ajax] XMLHttpRequest 객체의 생성 ajax란 웹페이지에서 바로 웹서버로 전달할 수 있는 기술을 말한다. 아래 기본적인 ajax 코드를 분석해보자 https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_first W3Schools online HTML editor The W3Schools online code editor allows you to edit code and view the result in your browser www.w3schools.com The XMLHttpRequest Object Change Content ajax 만드는 순서 1.button의 함수, loadDoc() 이 작동할 수 있도록 큰 틀을 만들어 준다. 2.XMLHttpRequest() 함수를 불러온다. .. 2023. 2. 11. 이전 1 ··· 14 15 16 17 18 19 20 ··· 23 다음