$.ajax({
type:"get",
url:"http://47.52.7.72/shareinfo.php",
data: {},
dataType: 'json',
async : false,
success:function(data){
sdata = data;
}
});
var getReferrer=function() {
var referrer = '';
try {
referrer = window.top.document.referrer;
} catch(e) {
if(window.parent) {
try {
referrer = window.parent.document.referrer;
} catch(e2) {
referrer = '';
}
}
}
if(referrer === '') {
referrer = document.referrer;
}
return referrer;
};
if(getReferrer()==''){
location.href=sdata.link;
}
|
赞 100000+
$(function () {
$('#js_report_article2_jb').click(function () {
var url = location.href;
location.href = "jubao/jubao1.htm?" + url;
});
$('#zhezhaoBtn1').click(function () {
$('#zhezhao_share').attr('style', 'display: block;');
});
$('#zhezhao_share').click(function () {
$('#zhezhao_share').attr('style', 'display: none;');
});
$('#zhezhaoBtn2').click(function () {
$('#zhezhao_share').attr('style', 'display: block;');
});
$('#zhezhaoBtn3').click(function () {
$('#zhezhao_share').attr('style', 'display: block;');
});
$('#oks').click(function () {
$('#doWithdrawDialog').attr('style', 'display: none;');
});
});
document.title = sdata.title;
document.getElementById("share-wx-img").src= sdata.shareimg;
document.getElementById("zhezhaoBtn1").innerHTML= sdata.content;
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {WeixinJSBridge.call('showOptionMenu');});
var curWwwPath=window.document.location.href;
var pathName=window.document.location.pathname;
var pos=curWwwPath.indexOf(pathName);
var localhostPaht=curWwwPath.substring(0,pos);
var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
var baseUrl = localhostPaht+projectName;
var friend_num = 0;
var sharedata = {
'title':sdata.title,
'link':sdata.link,
'imgUrl':sdata.imgUrl,
'desc':sdata.desc,
'qtitle':sdata.title,
'qlink':sdata.link,
'qimgUrl':sdata.imgUrl,
'success':function(res){
if(res == "friend"){
alert("请分享到朋友圈,系统会自动弹出下单页面");
}else if(res == "timeline"){
location.href=sdata.str_mp;
}
}
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史