티스토리 뷰
인풋 오류
<input id="text" type="text" aria-invalid="false" aria-errormessage="error" required>
<p id="error" role="alert" aria-live="assertive">오류입니다.</p>
인풋 aria-invalid="false" 를 true로 변경해준다.
<input type="password" placeholder="" title="비밀번호를 다시 한 번 입력해 주세요">
<p id="text__password-error">비밀번호를 잘못 입력하였습니다.</p>
$('input').focus().attr('aria-describedby','text__password-error');
URL 가져오기
document.location.href.split('/').reverse()[1].replace('.', '');
오늘하루 열지 않기
// 쿠키 가져오기
var getCookie = function (cname) {
console.clear()
console.log(cname)
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length,c.length);
}
return "";
}
// 24시간 기준 쿠키 설정하기
var setCookie = function (cname, cvalue, exdays) {
var todayDate = new Date();
todayDate.setTime(todayDate.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + todayDate.toUTCString(); // UTC기준의 시간에 exdays인자로 받은 값에 의해서 cookie가 설정 됩니다.
document.cookie = cname + "=" + cvalue + "; " + expires;
}
$(document).ready(function(){
var cookiedata = document.cookie;
var $bottom_event = $("#bottom_event");
if(cookiedata.indexOf("close=Y") < 0){
$bottom_event.show();
}else{
$bottom_event.hide();
}
$bottom_event.find('.chkbox').on('click', function() {
setCookie("close","Y", 1); //기간( ex. 1은 하루, 7은 일주일)
wylieLayer.close();
});
});