function commonAjax(options) { var jqxhr = $.ajax({ url : options.url, type : options.type || 'post', contentType : 'application/json', dataType : options.dataType || 'json', data : JSON.stringify(options.data), async : options.isAsync || true, cache : false, //success : options.succCallback || __default_succCallback__, //error : options.errCallback || __default_errCallback__, //complete : options.cmplCallback || __default_cmplCallback__, beforeSend : options.before || function() {} }); return jqxhr; } $(document).ready(function () { //특수문자+공백 정규식 const specialCharRegExp = /[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"\s]/g; //헤더부분 검색 버튼 이벤트 $('#btn_globalsearch').on('click', function(e){ if($('form[name=global-search] select[name=globalSearchType]').val() == 'prdName') { $('form[name=global-search]').attr('action', g_context_path + "/rebpp/usr/prd/prdInfoList.do"); $('form[name=global-search]').attr('method', 'post'); $('form[name=global-search]').submit(); } else { $('form[name=global-search] input[name=searchGbn]').val('2'); $('form[name=global-search]').attr('action', g_context_path + "/rebpp/usr/prd/prdInfoList.do"); $('form[name=global-search]').attr('method', 'post'); $('form[name=global-search]').submit(); } }); //헤더부분 검색 입력란에서 enterkey event $('form[name=global-search] input').keydown(function (key) { if (key.keyCode == 13) { $("#btn_globalsearch").trigger("click"); } }); //회원가입 사업자번호, 회원 정보 수정 사업자번호 특수문자+공백 체크 $('#enterpriseNumber').on('keyup', function() { const input = $(this).val(); if(input.length>0){ if(input.match(specialCharRegExp)){ $('#layer-alert5 .popup-body p').text('특수 문자를 입력할 수 없습니다.'); openModal('#layer-alert5', this); $(this).val($(this).val().replace(specialCharRegExp, "")) return; } } }); });