This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// JOIN 버튼을 누르는 순간에 sessionStorage 혹은 localStorage 에 원하는 데이터 저장 | |
/* | |
- localStorage: 저장하는 기간 제한 없음 | |
- sessionStorage: 일정 기간이 지나면 데이터 삭제 | |
- 두 storage 모두 getItem 과 setItem 으로 데이터 저장 및 조회 | |
*/ | |
sessionStorage.setItem('userName', document.querySelector('#username')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
$('#enter').on('click', function() { | |
// ajax 등을 이용해 세션에 저장할 내용 전달 | |
$.ajax({ | |
url:'/login', | |
// 세션에 저장하고자 하는 data를 post 로 보냄 | |
data: { | |
userName: document.querySelector("#username").value, | |
roomName: document.querySelector("#roomname").value |