//SNSボタンを表示する var sasa_sns_img_path = "/~/media/cojp/product/printer/home/magazine/img/sns/"; $(document).ready(function() { // // var url_o, enc_url; url_o = location.href; enc_url = encodeURIComponent(url_o); var title_o = document.title; var enc_title = encodeURIComponent(document.title); var enc_title_tw = enc_title; enc_title = sa_escspecialchars(enc_title); var addstr; var sabtnstr = new Array(); //twitter addstr = 'ツイート'; sabtnstr.push(addstr); //facebook addstr = "http://www.facebook.com/sharer/sharer.php?u="+enc_url+"&t="+enc_title+""; addstr = 'Facebookシェア'; sabtnstr.push(addstr); //LINE addstr = "http://line.me/R/msg/text/?"+enc_title+" "+enc_url+""; addstr = 'LINEで送る'; sabtnstr.push(addstr); //hatebu var enc_title_ht = title_o.replace(/"/g,"""); addstr = 'このエントリーをはてなブックマークに追加'; sabtnstr.push(addstr); // // var sastr=""; var sv=0; for (sv in sabtnstr) { sastr += " "+sabtnstr[sv]; } $(sastr).appendTo("#snsPart"); // $(".snspopup").click(function(){ window.open(this.href, "sns","width=700,height=500,resizable=yes,scrollbars=yes"); return false; }); }); function sapop(hf) { window.open(hf, "sns","width=700,height=500,resizable=yes,scrollbars=yes"); } function sa_escspecialchars(string) { var chrtable = [ [/\\/g, "\\\\"],//1st replace [/&/g, '&'], [//g, '>'], [/\//g, "\\/"], [/"/g, '\\"'], [/'/g, "\\'"] ]; for (var i in chrtable) { string = string.replace(chrtable[i][0], chrtable[i][1]); } return string; }