(function(appNames, scriptUrls, cssUrls) { var protocol = window.location.hostname === 'cmnt.zum.com' ? window.location.protocol : 'https:'; if (appNames.length != scriptUrls.length) { console.error('the count of the app-names and the script-urls do not match'); return; } var makeCss = function(hrefUri) { var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = protocol + hrefUri; head.appendChild(link); link = null; }; var makeJs = function(appName, scriptUrl) { var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = protocol + scriptUrl; head.insertBefore(script, head.firstChild); runCallbackFunc(appName, script); script = null; }; var runCallbackFunc = function(appName, script) { var done = false; script.onload = script.onreadystatechange = function() { if (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) { done = true; // zca_callback & zav_callback must be pre-defined in web page. if (appName === 'zca') { if (typeof zca_callback === 'function') { zca_callback(); } } else if (appName === 'zav') { if (typeof zav_callback === 'function') { zav_callback(); } } script.onload = script.onreadystatechange = null; } } }; var i; for (i = 0; i < cssUrls.length; i++) { makeCss(cssUrls[i]); } for (i = 0; i < appNames.length; i++) { makeJs(appNames[i], scriptUrls[i]); } }([ 'zca','zav' ], [ '//cmnt.zum.com/plugin/zum-comment/js/zum_comment_app.min.js?ver=1.6.3-20230831-102824','//cmnt.zum.com/plugin/zum-comment/js/zum_article_vote.min.js?ver=1.6.3-20230831-102824' ], [ '//cmnt.zum.com/plugin/zum-comment/css/module_page_like_news_2.css?ver=1.6.3-20230831-102824','//cmnt.zum.com/plugin/zum-comment/css/module_social_comment.css?ver=1.6.3-20230831-102824','//cmnt.zum.com/plugin/zum-comment/css/module_social_comment_newszum_2.css?ver=1.6.3-20230831-102824' ] ));