function url_scroll(arr) { $.each(arr, function (index, val) { $('body').append(''); }); } function showHytech(data,i,project,projectName){ var ad_pos = project+"_tips_2" var currentIndex = i; if(data.script[i].content) { var hytechConfig = JSON.parse(data.script[i].content); var hytechData = { "media": { "type": 3, "browser":{ "user_agent":ProjectConfig.GetQueryString('browser')}}, "client": { "type": 3, "version":"1.8"}, "adslot": { "id":hytechConfig.id, "type": 1, "height": 100, "width": 640}, // "network": { "type": 1} } var hytechData =JSON.stringify(hytechData); window.uploadConfig= { act:"request", ad_id:data.baidu_id, ad_pos:ad_pos, ad_type:'dsp_hytech', strategy_id:data.script[i].strategy_id, idea_id:data.script[i].idea_id, plan_id:data.script[i].plan_id, product_category:data.script[i].product_category } render=false; $.ajax({ type: "post", url: hytechConfig.url, dataType: "json", data:hytechData, success: function (res) { if(res){ if(res.success==true) { if(res.ads.native_material.type ==2||res.ads.native_material.type ==7) {//图文 var ads = JSON.parse(res.ads.native_material.image_snippet); $('.container').css({"width":"825px","height":"105px"}); var dom ='
不感兴趣
关闭
'+projectName+'-广告由虹采广告提供' + ''; $('.container').append(dom); uploadConfig.act = 'show'; uploadZhike(uploadConfig); url_scroll(ads.imp); var page_size = '825,105'; $('head').append(''); if (typeof window.external != 'undefined' && typeof window.external.CppCall != 'undefined') { window.external.CppCall(page_size); } $('.dsp_ad').on('click', function () { uploadConfig.act = 'click'; uploadZhike(uploadConfig); url_scroll(ads.clk); }); }else{ render = true; var start = currentIndex + 1; renderFunc(start,dataRes); } } else{ render = true; var start = currentIndex + 1; renderFunc(start,dataRes); } }else if(typeof(res)=="undefined"){ render = true; var start = currentIndex + 1; renderFunc(start,dataRes); } }, error:function () { render = true; var start = currentIndex + 1; renderFunc(start,dataRes); } }); } }