1 function kbmjTrackback(serial, id, option, charset, target_id) {
2 kbmjKuchikomi("tb", serial, id, option, charset, target_id);
4 function kbmjComment(serial, id, option, charset, target_id) {
5 kbmjKuchikomi("cm", serial, id, option, charset, target_id);
7 function kbmjKuchikomi(type, serial, id, option, charset, target_id) {
8 var host = "recommend.kbmj.com";
9 var url = location.protocol + "//" + host;
10 option = option ? "&" + option : "" ;
12 if(!navigator.userAgent.match(/Mozilla\/4\.0 \(compatible; MSIE 5\.\d*; (Windows|MSN|AOL)/
18 target_id = target_id || "kbmj_comment";
23 target_id = target_id || "kbmj_trackback";
26 url += serial + "/" + id + "?target_id=" + target_id + "&charset=" + charset + option;
28 var func = function(){
29 var script = document.createElement('script');
30 script.setAttribute('type', 'text/javascript');
31 script.setAttribute('charset', charset);
32 script.setAttribute('src', url);
33 var target = document.getElementById(target_id);
34 target.appendChild(script);
36 if(window.addEventListener){
37 window.addEventListener('load', func, false);
38 }else if(window.attachEvent){
39 window.attachEvent('onload', func);