如何落伍 | 站长俱乐部 | 落伍预告 | 落伍分类 | 站长运营 | 站长赚钱 | 免费代码 | 现金任务 | 人才招聘 | 落伍DIY | 站长工具 | 我喜爱的人民警察
推荐:图铃+艺术签名效果强!年底暴利,淘宝CPC1000ip/50元弹窗,点击,自定义多种广告 强力推荐:签名+Q号.无线金玉
推荐!27by日结联盟,日赚300精品段E7300 4999元 真百独999元20人合租 赠CDN加速 399¥/年51联盟轻松月赚1万!(信誉第一)
挚盟:签名+杀毒+考考你英拓0元送机托管活动08联盟为你打破图铃新纪录10M独享租用550元-合租80/月
DNSPod智能DNS,我们一直在免费九播联盟 小站长日赚500不是梦上海服务器酷睿租用499/月一年送产权5G双线主机59.8元/月,可试用3天
发新话题
打印

这两天刚流行起来的,做adsense推介firefox专用~

这两天刚流行起来的,做adsense推介firefox专用~

body上边调用js代码。js代码内容如下:

// This function does the actual browser detection
function writeCookie(name, value, hours)
{
        var expire = "";
        if(hours != null)
        {
                expire = new Date((new Date()).getTime() + hours * 3600000);
                expire = "; expires=" + expire.toGMTString();
        }
        document.cookie = name + "=" + escape(value) + expire;
}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
        var cookieValue = "";
        var search = name + "=";
        if(document.cookie.length > 0)
        {
                offset = document.cookie.indexOf(search);
                if (offset != -1)
                {
                        offset += search.length;
                        end = document.cookie.indexOf(";", offset);
                        if (end == -1) end = document.cookie.length;
                        cookieValue = unescape(document.cookie.substring(offset, end))
                }
        }
        return cookieValue;
}



function hasIE_hasIE() {
  var ua = navigator.userAgent.toLowerCase();
  return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) &&
          (ua.indexOf('webtv') == -1) &&
          (location.href.indexOf('seenIEPage') == -1));
}

function hasIE_showLayer(whichLayer)
{
  if (document.getElementById)
    {
      var style2 = document.getElementById(whichLayer).style;
      style2.display = "block";
    }
  else if (document.all)
    {
      var style2 = document.all[whichLayer].style;
      style2.display = "block";
    }
  else if (document.layers)
    {
      var style2 = document.layers[whichLayer].style;
      style2.display = "block";
    }
}

// Hides and shows sections of the page based on whether or not it's
// running in IE
function hasIE_hideAndShow()
{
  if (hasIE_hasIE())
  {
    hasIE_showLayer("hasIE_level1");  
  }
  else{}
}

function hasIE_ContinueWithoutFF() {
    if (location.href.indexOf('?') != -1)
        location.href += '&seenIEPage=1';
    else
        location.href += '?seenIEPage=1';
}
function closediv(i) {
        writeCookie("status","showed24",140);
        document.getElementById(i).style.display='none';
}

document.write("<div id=\"hasIE_level1\" style=\"background:#FFFFBB; text-align: center; padding:2px 0 3px; display:none; border-bottom:1px solid #ffd532;position:absolute; top:0; left:0; width:100%; z-index:100\"><div id=\"iewarning\" style=\"width:19px; float:left;\"><img align=\"absmiddle\" src=\"http://www.nkcn.net/images/warning.gif\" border=\"0\" /></div><div id=\"closeimg\" style=\"width:19px; float:right;\"><a href=\"javascript:closediv('hasIE_level1');\" title=\"关闭提示\"><img src=\"http://www.nkcn.net/images/close1.gif\" align=\"absmiddle\" border=\"0\" /></a></div><div style=\" margin-top:4px;marign-left:4px;font-size:12px;color:#092E20\">发现您正在使用老掉牙的IE浏览器,强烈推荐您在 Windows 操作系统中使用最安全的浏览器: <a href=\"http://www.nkcn.net/firefox/\" title=\"FireFox火狐浏览器2.0下载\" target=\"_blank\"><font color=\"#ee0000\">FireFox火狐浏览器2.0,点击下载</a></font> !</div></div><div style=\"clear:both\"></div>");  
if(document.referrer.indexOf("hao123")==-1 && document.referrer.indexOf("hao222")==-1)
{
        if(readCookie("status") != "showed24")
        {
                hasIE_hideAndShow();
        }
}



效果演示:www.nkcn.net   最上边的提示~~黄色的。。。 所需图片请根据地址下载。做完以后记得找个firefox推介专用页面哦

TOP

没人理?

TOP

这年头。。写什么都没人理了。~

TOP

发新话题