(function () { var service = { opt: function () { console.log('memberExistPopup opt not setting') } }; $('body').append($('
')) $("#memberExistPopupGroup").load('/cdn/template/memberExistPopupGroup.tpl', function () { $('#btnPopupReRegister').on('click', function () { service.handle(); service.close(); }) $('.memberExistPopup .close').on('click', function () { console.log('123') service.close(); }) }) service.show = function () { document.getElementById('memberExistPopup1').classList.add('on'); } service.next = function () { document.getElementById('memberExistPopup1').classList.remove('on'); document.getElementById('memberExistPopup2').classList.add('on'); } service.close = function () { for (let item of document.getElementsByClassName('memberExistPopup')) { item.classList.remove('on') } } service.handle = function () { var opt = service.opt; if (typeof opt === 'string') { location.href = opt } else if (typeof opt === 'function') { opt(); } else if (typeof opt === 'object') { var href = opt.url; location.href = href } } service.do = function (opt) { service.opt = opt; } window.memberExistPopup = service })(); // setTimeout(function () {memberExistPopup.do(function(){ // alert('goto reregister page') // }}, 500)