Skip to content

Instantly share code, notes, and snippets.

@blaswan
Last active October 23, 2017 08:12
Show Gist options
  • Save blaswan/d1c864615799d32e6950644dc3c40265 to your computer and use it in GitHub Desktop.
Save blaswan/d1c864615799d32e6950644dc3c40265 to your computer and use it in GitHub Desktop.
(function() {
if (window.CHPlugin) {
return window.console && console.error && console.error('Channel Plugin script included twice.');
}
var ch = { q: [] };
['initialize', 'checkIn', 'checkOut', 'show', 'hide', 'track', 'timeTrack'].forEach(function(e) {
ch[e] = function() {
var n = Array.prototype.slice.call(arguments);
n.unshift(e);
ch.q.push(n);
}
});
window.CHPlugin = ch;
var node = document.createElement('div');
node.id = 'ch-plugin';
document.body.appendChild(node);
var async_load = function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//cdn.channel.io/plugin/ch-plugin-web.js';
s.charset = 'UTF-8';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
};
if (window.attachEvent) {
window.attachEvent('onload', async_load);
} else {
window.addEventListener('load', async_load, false);
}
})();
window.CHPlugin.initialize({
plugin_id: 'YOUR_PLUGIN_ID',
hide_default_launcher: false
});
@r45r54r45
Copy link

이부분 올바르게 작성하신 것 맞나요?
19번째 줄 s.src = './ch-plugin-web-dev.js';

@blaswan
Copy link
Author

blaswan commented Mar 3, 2017

@r45r54r45 레포팅 감사합니다. 수정했습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment