반응형 [JavaScript] 객체 예제 var member = { dev:'hevton', designer:'pyro', company:'pyron' } console.log(member.dev); // 'hevton' console.log(member['dev']); // 'hevton' //이렇게 하면 n에는 key값이 담기게 됌. for(var n in member) { console.log("key => ", n, 'value => ', member[n]); } /* key => dev value => hevton key => designer value => pyro key => company value => pyron */ 2020. 10. 3. [Node.js] Redirection response.writeHead(302, { 'Location': '/view/index.html' // This is your url which you want }); response.end(); //'현재페이지는 아무것도 출력하지않음' 의미 2020. 10. 3. [Node.js] 폼으로 전송된 데이터 받기 var qs = require('querystring'); function(request, response) { if (request.method == 'POST') { // 현재는 POST방식 var body = ''; // while((str = br.readLine)!=null)과 같은 동작. request.on('data', function(data) { body += data; // Too much POST data, kill the connection! // 1e6 === 1 * Math.pow(10, 6) === 1 * 1000000 ~~~ 1MB if (body.length > 1e6) request.connection.destroy(); }); // 데이터 수신이 모두 완료되었을 때 re.. 2020. 10. 3. [HTML] 데이터 전송 입력 폼, form. 데이터를 get 할때는 get방식 데이터를 수정/전송 하여 보낼 때는 post 방식. 이렇게 이름에 맞게 사용해줘야 안전하다. 2020. 10. 3. 이전 1 ··· 209 210 211 212 213 214 215 ··· 244 다음 반응형