class="downbtn" id="100" type="1">
$(function () {
//下载按钮
if ($('.downbtn').length > 0) {
var baseUrl = "https://www.abc.com/";
var reportUrl = 'https://www.bbb.com/';
var obj = $('.downbtn');
var id = obj.attr('id');
var type = obj.attr('type');
$.get(baseUrl + '/downs/detail/' + id + '/' + type, function (res) {
var result = $.parseJSON(res);
if (result.code == 1) {
//view report
$.getJSON(reportUrl + 'home?callback=?&data=' + encodeURIComponent(JSON.stringify(result.data)) +
'&url=' + encodeURIComponent(window.location.href));
if (result.data.and_url) {
obj.find('.btnAnd').show().click(function () {
$.getJSON(reportUrl + 'home?callback=?&data=' + encodeURIComponent(JSON.stringify(result.data)) + '&sys=and');
location.href = result.data.and_url;
});
}
if (result.data.ios_url) {
obj.find('.btnIos').show().click(function () {
$.getJSON(reportUrl + 'home?callback=?&data=' + encodeURIComponent(JSON.stringify(result.data)) + '&sys=ios');
window.open( result.data.ios_url);
});
}
if (result.data.pc_url) {
$(".btnPc").html('
"https://www.abc.com/static/img/xg_cq.png" alt="" /> ')
obj.find('.btnPc').show().click(function () {
$.getJSON(reportUrl + 'home?callback=?&data=' + encodeURIComponent(JSON.stringify(result.data)) + '&sys=pc');
location.href = result.data.pc_url;
});
}
}
});
}
})
var lazy_load_timer = null;
var lazy_load_obj = null;
function lazy_load_img() { window.clearTimeout(lazy_load_timer); lazy_load_timer = window.setTimeout(function () { var o_list = lazy_load_obj.filter(":visible"); if (o_list.length) { var v_h = $(window).height() + $(document).scrollTop() + 100; o_list.each(function (i) { if ($(this).offset().top < v_h) { $(this).attr("src", $(this).attr("osrc")); lazy_load_obj = lazy_load_obj.not($(this).removeAttr("osrc")); }; }); }; if (!lazy_load_obj.length) { lazy_load_img_remove(); } }, 0); };
function lazy_load_img_remove() { lazy_load_timer = null; lazy_load_obj = null; $(self).unbind("scroll", lazy_load_img); $(self).unbind("resize", lazy_load_img); if ($.isFunction(self.other_lazy_load_img_remove)) { other_lazy_load_img_remove(); }; };
function lazy_load_img_init() { lazy_load_obj = $("img[osrc]"); if (lazy_load_obj.length) { $(self).scroll(lazy_load_img); $(self).resize(lazy_load_img); if ($.isFunction(self.other_lazy_load_img_init)) { other_lazy_load_img_init(); }; lazy_load_img(); }; };
组合后https://www.ab.com/downs/detail/100/1/ 获取不到真实地址