jQuery(document).ready(function() {
if ( jQuery(location).attr('hostname') !== 'kmong-item.tistory.com' ) {
jQuery('.contact').html('
[테스트] 위 비밀번호 입력창에 아무 단어를 입력해 보세요
');
}
jQuery('.demo-notice').before('');
jQuery(document).on('submit', '#download-file-with-password-form', function (e) {
e.preventDefault();
var url = 'https://www.wp-kr.com/demo/item/auto-content-lock/download-file-with-password/server/';
var formData = {
'password': jQuery('input[name=password]').val(),
'human-check': jQuery('input[name=human-check]').val()
};
jQuery.ajax({
type: 'POST',
url: url,
data: formData
})
.done(function(data) {
// console.log(data);
if ( data !== '' ) {
// jQuery('#download-file-with-password').remove();
jQuery('#download-file-with-password-message').empty();
window.location = data;
jQuery('#download-file-with-password-form')[0].reset();
} else {
jQuery('#download-file-with-password-message').html('올바른 비밀번호를 입력해 주세요 (비밀번호: demo )');
}
});
});
});