广告代码<script type="text/javascript">
u_a_client="5585";
u_a_width="131"; 
u_a_height="196"; 
u_a_zones="6688"; 
u_a_type="1"; 
</script>
<script src="http://ujs.56wan.com/i.js"></script>将以上代码添加到网页里,右下角就会弹出一个小广告。
(在u.56wan.com申请一下,获取的代码欠入的网站要跟申请时填写的网站相对应 .用户名 tianho 密码 fordgt)请教一下,这种弹出广告是怎么实现的?附  i.js文件 (function(){function s(b){return b!=null?'"'+b+'"':'""'}function e(b){if(typeof encodeURIComponent=="function"){return encodeURIComponent(b)}else{return encodeURI(b)}}function G(n,v){if(v){window.u_a_url+="&"+n+"="+v}}function D(w,t,d){var s=w.screen,j='0';tz=-t.getTimezoneOffset();if(navigator.javaEnabled())j='1';if(s){G("u_a_type",w.u_a_type);G("z_sh",s.height);G("z_sw",s.width);G("z_scd",s.colorDepth)}G("z_c_url",w.union_code_url);G("z_uref",w.union_ref_url);G("z_urefk",w.union_ref_k);G("z_utz",tz/60);G("z_uhis",history.length);G("z_ujava",j);G("z_ufv",F());if(navigator.plugins){G("z_unplug",navigator.plugins.length)}if(navigator.mimeTypes){G("z_unmime",navigator.mimeTypes.length)}}function B(w,d){return w.top.location==d.location}function S(w,a,sr){if(w.u_a_type=="1"){a.write('<script language="JavaScript1.1" src='+s(sr)+" charset=gbk><\/script>")}else{a.write('<iframe name="u_a_iframe" width='+s(w.u_a_width)+" height="+s(w.u_a_height)+" frameborder=0 src="+s(sr)+' marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">');a.write("</iframe>")}}function A(){var w=window,d=document,t=new Date;w.u_a_url="http://u.56wan.com/show.php?";w.u_a_url+="z_uid="+w.u_a_client;w.u_a_url+="&zoneid="+w.u_a_zones;if(w.union_num_ads_zone){w.union_num_ads_zone=w.union_num_ads_zone+1}else{w.union_num_ads_zone=1}if(w.union_num_ads_zone>10){return}if(B(w,d)&&d.body){var j=d.body.scrollHeight,v=d.body.clientHeight;if(v&&j){G("z_uc_ks",Math.round(j))}}D(w,t,d);S(w,d,w.u_a_url)}function C(w,d){return true}function E(){var w=window,d=document,e=null;g=d.referrer,w.onerror123=C;if(w.union_code_url==e){w.union_code_url=escape(w.location);if(!B(w,d)){w.union_code_url=g}}w.union_ref_url='';if(B(w,d)&&g){w.union_ref_url=escape(g)}}var Z={};function ya(b){if(b in Z)return Z[b];return Z[b]=navigator.userAgent.toLowerCase().indexOf(b)!=-1}function F(){if(navigator.plugins&&navigator.mimeTypes.length){var b=navigator.plugins["Shockwave Flash"];if(b&&b.description)return b.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var a=3,c=1;while(c)try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(a+1));a++}catch(e){c=null}return a.toString()}else if(ya("msie")&&!window.opera){var c=null;try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){var a=0;try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=6;c.AllowScriptAccess="always"}catch(e){if(a==6)return a.toString()}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(c!=null){var a=c.GetVariable("$version").split(" ")[1];return a.replace(/,/g,".")}}return"0"}function K(r){var s=["wd","p","q","keyword","kw","w","key","word","query","q1","name"];if(r!=""&&r!=null){for(var i=0;i<s.length;i++){var re=new RegExp("[^1-9a-zA-Z]"+s[i]+"=\([^&]*\)");var kk=r.match(re);if(kk!=null){return kk[1]}}}return""}E();A()})();

解决方案 »

  1.   

    你自己写个JS
    可以生成个DIV里面的内容随便
    然后DIV添加到body中 在控制下DIV的位置吧JS封装下 就是这样了
      

  2.   

    1楼正解。
    你自己提供的js,把格式调整好你就会发现它在页面中插入了个iframe。这个iframe应该是连接到广告页面的。
      

  3.   

    1楼说的对,我试了下,简单实现了.但是要具体实现得专门写个JS, 我火候不足,也没那么多时间.
    我上面提供的JS里能生成iframe ,但我看不懂弹出广告是怎么实现的.
      

  4.   

    i.js(
    function()
    {
    //alert("1");
    function s(b)
    {
    return b!=null?'"'+b+'"':'""'
    }
    function e(b)
    {
    if(typeof encodeURIComponent=="function")
    {
    return encodeURIComponent(b)
    }
    else
    {
    return encodeURI(b)
    }
    }
    function G(n,v)
    {
    if(v)
    {
    window.u_a_url+="&"+n+"="+v
    //alert(window.u_a_url);
    }
    }
    function D(w,t,d)
    {
    var s=w.screen,j='0';
    tz=-t.getTimezoneOffset();
    if(navigator.javaEnabled())
    j='1';
    if(s)
    {
    G("u_a_type",w.u_a_type);
    G("z_sh",s.height);
    G("z_sw",s.width);
    G("z_scd",s.colorDepth)
    }
    G("z_c_url",w.union_code_url);
    G("z_uref",w.union_ref_url);
    G("z_urefk",w.union_ref_k);
    G("z_utz",tz/60);
    G("z_uhis",history.length);
    G("z_ujava",j);
    G("z_ufv",F());
    if(navigator.plugins)
    {
    G("z_unplug",navigator.plugins.length)
    }
    if(navigator.mimeTypes)
    {
    G("z_unmime",navigator.mimeTypes.length)
    }
    }
    function B(w,d)
    {
    return w.top.location==d.location
    }
    function S(w,a,sr)
    {
    alert(sr);
    if(w.u_a_type=="1")
    {
    a.write('<script language="JavaScript1.1" src='+s(sr)+" charset=gbk><\/script>")
    }
    else
    {
    a.write('<iframe name="u_a_iframe" width='+s(w.u_a_width)+" height="+s(w.u_a_height)+" frameborder=0 src="+s(sr)+' marginwidth="0" marginheight="0" align=right vspace="0" hspace="0" allowtransparency="true" scrolling="no">');
    a.write("</iframe>")

    //+'style="Z-INDEX: 1001; LEFT: "'+window.screen.width+"; POSITION: absolute; TOP: "+window.screen.height+
    }
    }
    function A()
    {
    var w=window,d=document,t=new Date;//w.u_a_url="http://u.56wan.com/show.php?";
    //w.u_a_url="ad.aspx?";
    //w.u_a_url="webTest/1.aspx?";
    w.u_a_url+="uid="+w.u_a_client;
    w.u_a_url+="&zoneid="+w.u_a_zones; //Zone编号
    //alert(w.u_a_url);
    if(w.union_num_ads_zone)
    {
    w.union_num_ads_zone=w.union_num_ads_zone+1
    }
    else
    {
    w.union_num_ads_zone=1
    }
    if(w.union_num_ads_zone>10)
    {
    return
    }
    if(B(w,d)&&d.body)
    {
    var j=d.body.scrollHeight,v=d.body.clientHeight;
    if(v&&j)
    {
    G("z_uc_ks",Math.round(j))
    }
    }
    D(w,t,d);
    S(w,d,w.u_a_url)
    //alert(w.u_a_url);

    }
    function C(w,d)
    {
    return true
    }
    function E()
    {
    var w=window,d=document,e=null;g=d.referrer,w.onerror123=C;
    if(w.union_code_url==e)
    {
    w.union_code_url=escape(w.location);
    if(!B(w,d))
    {
    w.union_code_url=g
    }
    }
    w.union_ref_url='';
    if(B(w,d)&&g)
    {
    w.union_ref_url=escape(g)
    }
    }
    var Z={};
    function ya(b)
    {
    if(b in Z)return Z[b];
    return Z[b]=navigator.userAgent.toLowerCase().indexOf(b)!=-1
    }
    function F()
    {
    if(navigator.plugins&&navigator.mimeTypes.length)
    {
    var b=navigator.plugins["Shockwave Flash"];
    if(b&&b.description)
    return b.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")
    }
    else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0)
    {
    var a=3,c=1;
    while(c)
    try
    {
    c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(a+1));a++
    }
    catch(e)
    {
    c=null
    }
    return a.toString()
    }
    else if(ya("msie")&&!window.opera)
    {
    var c=null;
    try
    {
    c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
    }
    catch(e)
    {
    var a=0;
    try
    {
    c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
    a=6;c.AllowScriptAccess="always"
    }
    catch(e)
    {
    if(a==6)
    return a.toString()
    }
    try
    {
    c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
    }
    catch(e){}
    }
    if(c!=null)
    {
    var a=c.GetVariable("$version").split(" ")[1];
    return a.replace(/,/g,".")
    }
    }
    return"0"
    }
    function K(r)
    {
    var s=["wd","p","q","keyword","kw","w","key","word","query","q1","name"];
    if(r!=""&&r!=null)
    {
    for(var i=0;i<s.length;i++)
    {
    var re=new RegExp("[^1-9a-zA-Z]"+s[i]+"=\([^&]*\)");
    var kk=r.match(re);
    if(kk!=null)
    {
    return kk[1]
    }
    }
    }
    return""
    }
    E();
    A()
    })

    ();
      

  5.   

    LZ有代码自己不看,广告一般都是加入iframe或div+a+img
      

  6.   

    iframe 里的 src 是PHP类型,换成c# .net应该怎么做
    iframe 位置怎么控制?