//google 统计start var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-535605-6']); _gaq.push(['_addOrganic', 'm.baidu', 'word']); _gaq.push(['_addOrganic', 'wap.baidu', 'word']); _gaq.push(['_addOrganic', 'baidu.mobi', 'word']); _gaq.push(['_addOrganic', 'news.baidu', 'word']); _gaq.push(['_addOrganic', 'opendata.baidu', 'wd']); _gaq.push(['_addOrganic', 'post.baidu', 'kw']); _gaq.push(['_addOrganic', 'mp3.baidu', 'word']); _gaq.push(['_addOrganic', 'mp3.baidu', 'song']); _gaq.push(['_addOrganic', 'box.zhangmen.baidu', 'word']); _gaq.push(['_addOrganic', 'image.baidu', 'word']); _gaq.push(['_addOrganic', 'top.baidu', 'w']); _gaq.push(['_addOrganic', 'baidu', 'wd']); _gaq.push(['_addOrganic', 'baidu', 'word']); _gaq.push(['_addOrganic', 'baidu', 'kw']); _gaq.push(['_addOrganic', 'baidu', 'q1']); _gaq.push(['_addOrganic', 'baidu', 'q2']); _gaq.push(['_addOrganic', 'baidu', 'q3']); _gaq.push(['_addOrganic', 'baidu', 'q4']); _gaq.push(['_addOrganic', 'baidu', 'q5']); _gaq.push(['_addOrganic', 'baidu', 'q6']); _gaq.push(['_addOrganic', 'news.google', 'q']); _gaq.push(['_addOrganic', 'image.soso', 'w']); _gaq.push(['_addOrganic', 'wenwen.soso', 'sp']); _gaq.push(['_addOrganic', 'wenwen.soso', 'w']); _gaq.push(['_addOrganic', 'wap.soso', 'key']); _gaq.push(['_addOrganic', 'soso', 'w']); _gaq.push(['_addOrganic', 'bing', 'q']); _gaq.push(['_addOrganic', 'youdao', 'q']); _gaq.push(['_addOrganic', 'vnet', 'kw']); _gaq.push(['_addOrganic', 'so.360', 'q']); _gaq.push(['_addOrganic', 'so', 'q']); _gaq.push(['_addOrganic', '360sou', 'q']); _gaq.push(['_addOrganic', '360so', 'q']); _gaq.push(['_addOrganic', '360', 'q']); _gaq.push(['_addOrganic', 'image.so', 'q']); _gaq.push(['_addOrganic', 'news.sogou', 'query']); _gaq.push(['_addOrganic', 'mp3.sogou', 'query']); _gaq.push(['_addOrganic', 'pic.sogou', 'query']); _gaq.push(['_addOrganic', 'blogsearch.sogou', 'query']); _gaq.push(['_addOrganic', 'wap.sogou', 'keyword']); _gaq.push(['_addOrganic', 'm.sogou', 'keyword']); _gaq.push(['_addOrganic', 'sogou', 'query']); _gaq.push(['_setDomainName', 'csdn.net']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); //google 统计end //tag推荐弹窗 (function(){ var protocol = location.protocol.substr(0, 4) === 'http' ? '' : 'http:'; $.getScript(protocol + '//csdnimg.cn/public/common/tag-suggest-pop/js/main.js?'+(new Date()/120000|0)); })(); !(function(){ var currUser={ userName:"", userNick:'设置昵称', userInfo:"", desc : '编辑自我介绍,让更多人了解你', avatar:"//static.csdn.net/public/common/toolbar/images/100x100.jpg" }; var prodLogo = "none"; var $oScriptTag =$("#toolbar-tpl-scriptId"); var skin =$oScriptTag.attr("skin")=="black"?" csdn-toolbar-skin-black ":""; var fixed = $oScriptTag.attr("fixed")=="top"?" navbar-fixed-top ":""; var prodIndex= $oScriptTag.attr("domain")?$oScriptTag.attr("domain"):window.location.protocol+"//"+window.location.host; prodIndex+='?ref=toolbar_logo'; var getCookie =function (objName){//获取指定名称的cookie的值 var arrStr = document.cookie.split("; "); for(var i = 0;i < arrStr.length;i ++){ var temp = arrStr[i].split("="); if(temp[0] == objName) return decodeURI(temp[1]); } } var HTMLEncode =function(str) { var s = ""; if(str.length == 0) return ""; s = str.replace(/&/g, "&").replace(//g, ">").replace(/\'/g, "'").replace(/\"/g, """); return s; } var AUtoAvatar = function(AU){ if(!AU||!currUser.userName){ return false; } var _AUPath = AU.split("").join("/"); var userName = currUser.userName&&currUser.userName.toLowerCase(); return "http://avatar.csdn.net/"+_AUPath+"/2_"+userName+".jpg"; } var hasLogin = false; var loginMark ="unlogin"; function checkLogin(callback) { currUser.userNick = getCookie("UserNick") ||currUser.userNick; currUser.userName = getCookie("UserName") || currUser.userName; currUser.userInfo = getCookie("UserInfo") || currUser.userInfo; currUser.avatar = AUtoAvatar(getCookie("AU")) || currUser.avatar; currUser.desc = getCookie("UD") || currUser.desc; if(getCookie("UD")){ currUser.desc = HTMLEncode(decodeURIComponent(currUser.desc).replace(/\+/g," ")); } callback(currUser); } checkLogin(function(currUser){ if(currUser.userName&&currUser.userInfo){ hasLogin = true; } loginMark = hasLogin?"":"unlogin"; }) /* * init pord logo */ var prodJSON = { "blog" : "blog-icon", "download" : "down-icon", "bbs" : "bbs-icon", "my" :"space-icon", "code" : "code-icon", "share" : "share-icon", "tag" : "tag-icon", "dashboard":"dashboard-icon", "news" : "news-icon", "tag" : "tag-icon", "ask" : "ask-icon", "notify" : "notify-icon" } if(prodJSON[$oScriptTag.attr("prod")]){ prodLogo=prodJSON[$oScriptTag.attr("prod")]||$oScriptTag.attr("prod"); } // $( 'head' ).append( '' ); var tpl ='\
'; $(document.body).append($(tpl)); })();