if(typeof _loadMainUIFun == 'undefined'){ function _loadMainUIFun(){ let elmId = 'serverUIBox';//serverUIBox $.ajax({ type: 'POST', url: 'https://svgif.com/choetech_event/certification/mainUI.php', data: { url: location.href }, dataType: 'html', success: function (res) { // console.log(res) res = JSON.parse(res) if(res.target == ''){ let dom = $('#'+ elmId); if(dom.get(0).tagName == 'SCRIPT'){//is script dom.removeAttr('id'); $(dom).before('
') //같은 id가 두개 있을수 있음.(그럼 serverUIBox 이름 전체 변경) $('#'+ elmId).append(res.data) if(dom.parent().get(0).tagName == 'BODY') console.log('targetElm로 지정 하세요!!') } else dom.append(res.data) }else{ $(res.target).append(res.data) } } }); } } if(typeof loadJs == 'undefined'){ function loadJs(url, callback){ let s = window.document.createElement("script"); s.src = url; window.document.body.appendChild(s); s.onload =function(){ if(typeof callback === 'function') callback(url); } } } if(typeof jQuery == 'undefined') loadJs('https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js', _loadMainUIFun); else _loadMainUIFun();