Chinaunix首页 | 论坛 | 博客
  • 博客访问: 77608
  • 博文数量: 15
  • 博客积分: 1420
  • 博客等级: 上尉
  • 技术积分: 160
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-12 18:50
文章分类

全部博文(15)

文章存档

2010年(2)

2009年(1)

2007年(12)

我的朋友

分类: 系统运维

2010-07-22 00:28:17

给大家分享一些SEO相关的知识技巧。
一个符合SEO规则的HTML代码展现大致如下:
********************************************************
1、
2、
3、
4、网页标题
5、
6、
7、
8、
9、
10、
11、
12、

13、

页面内容标题


14、

页面相关性标题


15、

标题系列


16、

标题系列


17、
标题系列

18、
标题系列

19、”图片说明”
20、链接词
21、重点关键词强调
22、关键词强调关键词强调关键词强调
23、

25、

26、版权部分关键词强调
27、

28、
29、
********************************************************
注:在..标签区中的罗列,都是一些基础的HTML标签,这些标签出现的次序是可以变化的。
下面来给大家详细解答一下。

第1行的
这个标签是用来做HTML代码注解的,很多站在这里会写上关键词,这种形式的注解在浏览器中是不会显示的,而搜索引擎可以读到。所以这个标签有的时候会成为作弊的一种形式,不要过多的用这种标签到来注明你的关键词,否则如果搜索引擎认为你是作弊的话,就惨了。

第4行页面标题。这是相当重要的!
这里字字值千金!对于做百度SEO的朋友,一定要记得这个标签可能是你是否真正能够做到排名靠前的重点,而且这个重点绝对不容忽视。标题主要注意你的用词,如果你做垃圾站,堆关键词也无所谓,如果你要做正规站点,请你正确对待,写得标准一点,不要堆关键字,保持你的主要词在这里出现三次就行,太多对你没有好处,对排名也不会有好处。GG并不喜欢太长的标题,百度也偶尔提到只希望在标题的前20个字里出现你的关键词。明确这些以后,还要注意的是,你的主要关键词应该在标题里越靠前越好!对于也可以参考以前的文章。

第7行这个的用途现在权重越来越低,但是再低都是有权重的,只要认真对待,这里的词是有效果的。
这里注意两点:
第一、大部分人都会选择在这里写关键词不会超过三个,有的人直接只写一个,这是有好处的,每一处标签都有权重,你强调的内容越少,那么它的权重会相对更高的,所以不要写太多,否则不如不写,而让搜索引擎自己去判断你的页面关键词。
第二、几乎所有的SEO专业人员都会跟你说尽量在每一个页面写不同的关键词,避免被认为是重复页面的危险。

第8行这个是主要为了在搜索结果里出现的索引结果的,索引结果就是在百度搜索你的站的时候标题下面的摘要内容。这是一个页面的导读,用来说明网页的主要内容,当然现在的权重不高,跟keywords标签一样,不太受重视。而且现在由于搜索引擎机器人的越来越智能化,基本上已经实现整个页面的摘要内容随意出现它的索引结果里了,搜索引擎会根据你搜索的内容不同显示不同的索引。你如果要写description,就认真去写,很多人是用这里来控制搜索引擎的索引显示的,因为网站描述写得越具体,就越有可能在索引的时候出现这个标签中的内容。

第13行

页面内容标题

这个标签是一个页面最重要的标签,也是搜索引擎定位这个页面的主要依据,如果你的

标签里没有出现你的页面关键字,那真是的一种很大的损失,这里的权重相对于其它的在区的标签来说更加重要。在HTML代码中,它的重要性仅次于。很多人放弃写这个标签,对于搜索引擎是很不友好的,你可以不出现其它的强调关键词的标签,但是这个标签一定要出现,这是告诉搜索引擎你的页面用一句话应该如何表达,如果这一行字都没有,再智能化的机器人可能都会以你的<title>来决定是否用来作为一个词的排名,很多时候一个网站的页面标题都是完全一样的,因为他们程序的原因,但是如果你没有办法修改title,已经损失很大了,而如果你的页面这个<h1>标签也没有出现的话,我不知道搜索引擎会怎么样去理解一个页面,对于SEO来说,那真很糟糕的一件事情。所以,认真对待你的页面<h1>,这是很重要的,要强调的是,这个标签一个页面不要出现太多,一次就行了,道理很简单,太多会让别人无法确定你页面中哪一个才是最重要的,无法确定重点跟没有这个标签我觉得没有太大的分别。所以,最好只出现1次,以达到明确说明的目的。</DIV> <DIV><BR>第14行<h2>页面相关性标题</h2>这个标签与<h1>是一样和道理,但是权重相对来说较低,如果你的页面没有<h1>,那么这个标签对于页面来说基本上就相当于<h1>的重要性了。这里面你包含的是长尾关键词相关的内容,比如你的页面做几个关键词,主词应该出现在<h1>里,那么其它的词以及你想发展的词就可以出现在<h2>里,这样来说是一种合理的安排。<BR>而<h3>~<h6>这些标签,重要性是依次递减的,在一个页面的权重越来越低。</DIV> <DIV><BR>第19行<img src=”xxx.jpg” alt=”图片说明”>我想这个标签很多人都知道,它的作用很明确,就是指定一张图片的说明文字,让搜索引擎知道这张图片是关于什么的。比如你的图片是”刘亦菲”,那么你的alt=”图片说明”中的”图片说明”就应该是与”刘亦菲”相关的词或者句子。这样写当然也有利于你在图片搜索的结果里显示排名更前面一点,不过现在百度基本上是以页面标题作为一张图片排名的要素,当然,你的alt标记做得好,将会增加你的图片匹配度。关于图片说明的研究,以后我也许会写一篇分析性的文章,因为有<a>链接的图片里,还会有一个title标签,title与alt这两个谁重要,是有必要研究一下的。</DIV> <DIV><BR>第20行<a href=”/” title=”链接说明”>链接词</a>这是链接说明,同时也是一个页面链接的SEO重点,这里的”链接词”相当的重要,如果你跟别人交换链接,你这个词的写法是起着外链好坏与否的决定性因素的。”链接词”建议你最好写成自己的关键词,如果觉得实在不行或者怎么样,你一定要在”链接说明”里出现你的关键词。否则对于排名,你的链接做得没有太大的好处。这在SEO专业术语里还有一种叫法,叫做”google炸弹”,就是用很多站点,同时做链接到一个网站,然后所有的”链接词”都写一个词-”刘亦菲”,不久以后google就会将这个站当做”刘亦菲”这个词最权威的站点,即使被那些站点链接的这个页面没有任何与”刘亦菲”相关的内容,这个网站在”刘亦菲”这个词的排名情况也会很好。不过google已经调整了算法,但是这样做链接肯定是有用的,一定要认真对待你的链接。还有一个重点,就是对方的链接,如果是JS调用的,你就别想在他那里得到任何权重,因为搜索引擎不会去读取JS里的内容,所以,建议大家好好做链接,不要做了链接你的站却跟没做一样。像百度空间的友情链接就是JS文件调用的,所以百度空间里的友情链接你是没有权重的。具体可以查看HTML代码,正常情况下一个页面你找不到你的网站地址在<a>..</a>标签内出现,基本上这就是属于无效链接。</DIV> <DIV><BR>第21行<strong>重点关键词强调</strong>这个标签基实重要性仅次于<h1>,很多人都这样跟我讲,我也基本上认同。很确定的是它比<b>、<u>、<i>等标签要权重高。所以如果你的页面有很重要的词,而你想强调它,首先选这个<strong>标签吧,接下来相对不重要的词强调请你选<b>、<u>、<i>等标签。当然,不要用得太多了,用得太多没有重点就等于没有用了。</DIV> <DIV><BR>第26行版权部分关键词强调<BR>我为什么要写这个?因为这个权重越来越高了,在底部版权部分,及很接近版权部分出现关键词,是一种手法。在这里强调你的关键词,是让你的关键词布局更加合理,而不是头部出现关键词,中部强调很多次,而底部却没有什么相关联的内容,这个词在这个页面是否值得怀疑呢?</DIV> <DIV><BR>当然,以上代码只是为了讲解才这样列出来的,不一定全要用上,要根据自己网站的情况而定,如上面5,6两行就要根据自己网站情况进行定义的。这是一篇比较老的文章,原作者已经不知道是谁了,不管怎么样,希望对大家有所帮助。 </DIV> <DIV></DIV> </div> <!-- <div class="Blog_con3_1">管理员在2009年8月13日编辑了该文章文章。</div> --> <div class="Blog_con2_1 Blog_con3_2"> <div> <!--<img src="/image/default/tu_8.png">--> <!-- JiaThis Button BEGIN --> <div class="bdsharebuttonbox"><A class=bds_more href="#" data-cmd="more"></A><A class=bds_qzone title=分享到QQ空间 href="#" data-cmd="qzone"></A><A class=bds_tsina title=分享到新浪微博 href="#" data-cmd="tsina"></A><A class=bds_tqq title=分享到腾讯微博 href="#" data-cmd="tqq"></A><A class=bds_renren title=分享到人人网 href="#" data-cmd="renren"></A><A class=bds_weixin title=分享到微信 href="#" data-cmd="weixin"></A></div> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> <!-- JiaThis Button END --> </div> 阅读(509) | 评论(2) | 转发(0) | <div class="HT_line3"></div> </div> <div class="Blog_con3_3"> <div><span id='digg_num'>0</span><a href="javascript:void(0)" id='digg' bid='2044971' url='/blog/digg.html' ></a></div> <p>上一篇:<a href="/uid-7741341-id-2044970.html">web图片区别</a></p> <p>下一篇:<a href="/uid-7741341-id-2044972.html">百度关键词的优化</a></p> </div> </div> <!-- <div class="Blog_con3_4 Blog_con3_5"> <div class="Blog_tit2 Blog_tit7">热门推荐</div> <ul> <li><a href="" title="" target='blank' ></a></li> </ul> </div> --> </div> </div> <div class="Blog_right1_7" id='replyList'> <div class="Blog_tit3">给主人留下些什么吧!~~</div> <!--不包含引用--> <div class="Blog_right1_8"> <div class="Blog_right_img1"><a href='/uid/7741341.html' ><img src="http://account.chinaunix.net/api/avatar.php?uid=7741341" /></a></div> <div class="Blog_right_font1"> <p class="Blog_p5"><span><a href='/uid/7741341.html' ><span>comerwang</span></a></span>2010-07-22 00:45:52</p> <p class="Blog_p6">做SEO的时候,常常会发现一个问题,就是自己的网站和另外的一个网站在各个方面的情况都是差不多的,可是别的网站就是比自己的排名要好,这是为什么呢? 当然,也许你没有注意到他在外链和内链建设上的优化点。我在做优化的时候,大部分精力都会用在代码的优化上,这也就是很多时候我做优化的时候,改动要比其他SEO从业者大的原因。 有一段时间我很提倡DIV+CSS的优化方案,因为我研究了很多搜索引擎,他们所提出将最符合标准的网页和最有阅读性的网页作为排名的一个因素,而DIV的网页恰恰是最符合W3C标准的网页。所以,我在很多时候都会将我所操作的项目重构。 但是我在前段时间的优化中,却忽视了一个问题,那就是搜索引擎的区块搜索性。什么叫区块搜索?举个例子,有一个网页,上面有正文,有标题,有链接,还有很多的广告,那么搜索引擎如何知道这样一个网页中哪些东西是我们需要搜索的呢?这就牵扯到区块搜索的问题。在搜索引擎的工作机制中,有很重要的一个过程就是筛选网页的内容,将有效的信息提出来,并存储到数据库和倒排表中,然后供人们索引。 代码的优化作用就要在这里体现了,那</p> <div class="div1"><a href="javascript:void(0);" class="Blog_a10" toid='7741341' bid='2044971' cid='304998' tname='comerwang'>回复</a> | <a href="javascript:;" onclick="link(this);showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login');" class='box_report'>举报</a></div> <!-- 评论占位框--> <div class='z_move_comment' style='display:none'> </div> </div> <div class="Blog_line1"></div> </div> <!--不包含引用--> <div class="Blog_right1_8"> <div class="Blog_right_img1"><a href='/uid/7741341.html' ><img src="http://account.chinaunix.net/api/avatar.php?uid=7741341" /></a></div> <div class="Blog_right_font1"> <p class="Blog_p5"><span><a href='/uid/7741341.html' ><span>comerwang</span></a></span>2010-07-22 00:40:00</p> <p class="Blog_p6">seo代码优化是SEO优化成功的关键 一个成功的seoer必须注意细节问题,整合网络营销专家一直认为seo优化成功的关键在于“细节”,下面我来讲解seo优化的细节-代码优化。许多seoer都不认为代码优化有多么重要,但是或许就是因为代码优化这一点被别人超越,下面我们讲解代码优化注意要点:   一.尽量采用div+css布局您的页面,div+css布局的好处是让搜索引擎爬虫能够更顺利的,更快的,更友好的爬完您的页面;div+css布局还可以大量缩减网页大小,使得代码更简洁,流畅,更容易放置更多内容。   二.尽量缩减您的页面大小,因为搜索引擎爬虫每次爬行您的站点时,存储数据的容量有限,一般建议100KB以下,越小越好,但不能小于5KB。网页大小减少还有一个好处,能够促使您的站点形成巨大的内部链接网。   三.尽量少用无用的图片和flash。内容索引所派出的搜索引擎爬虫,不认识图片,只能根据图片“ALT,TITLE”等属性的内容判断图片的内容。对于flash搜索引擎爬虫更是视而不见。   四.尽量满足w3c标准,网页代码的编写满足W3C标准,能够提升网站和搜索引擎</p> <div class="div1"><a href="javascript:void(0);" class="Blog_a10" toid='7741341' bid='2044971' cid='304999' tname='comerwang'>回复</a> | <a href="javascript:;" onclick="link(this);showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login');" class='box_report'>举报</a></div> <!-- 评论占位框--> <div class='z_move_comment' style='display:none'> </div> </div> <div class="Blog_line1"></div> </div> <!-- 评论分页--> <div class="Blog_right1_6 Blog_right1_12"> </div> <!-- 评论分页--> <div class="Blog_right1_10" style="display:none"> <div class="Blog_tit3">评论热议</div> <!--未登录 --> <div class="Blog_right1_8"> <div class="nologin_con1"> 请登录后评论。 <p><a href="http://account.chinaunix.net/login" onclick="link(this)">登录</a> <a href="http://account.chinaunix.net/register?url=http%3a%2f%2fblog.chinaunix.net">注册</a></p> </div> </div> </div> <div style="text-align:center;margin-top:10px;"> <script type="text/javascript" smua="d=p&s=b&u=u3118759&w=960&h=90" src="//www.nkscdn.com/smu0/o.js"></script> </div> </div> </div> </div> <input type='hidden' id='report_url' value='/blog/ViewReport.html' /> <script type="text/javascript"> //测试字符串的长度 一个汉字算2个字节 function mb_strlen(str) { var len=str.length; var totalCount=0; for(var i=0;i<len;i++) { var c = str.charCodeAt(i); if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { totalCount++; }else{ totalCount+=2; } } return totalCount; } /* var Util = {}; Util.calWbText = function (text, max){ if(max === undefined) max = 500; var cLen=0; var matcher = text.match(/[^\x00-\xff]/g), wlen = (matcher && matcher.length) || 0; //匹配url链接正则 http://*** var pattern = /http:\/\/([\w-]+\.)+[\w-]+(\/*[\w-\.\/\?%&=][^\s^\u4e00-\u9fa5]*)?/gi; //匹配的数据存入数组 var arrPt = new Array(); var i = 0; while((result = pattern.exec(text)) != null){ arrPt[i] = result[0]; i++; } //替换掉原文本中的链接 for(var j = 0;j<arrPt.length;j++){ text = text.replace(arrPt[j],""); } //减掉链接所占的长度 return Math.floor((max*2 - text.length - wlen)/2 - 12*i); }; */ var allowComment = '0'; //举报弹出层 function showJuBao(url, cid){ $.cover(false); asyncbox.open({ id : 'report_thickbox', url : url, title : '举报违规', width : 378, height : 240, scroll : 'no', data : { 'cid' : cid, 'idtype' : 2 , 'blogurl' : window.location.href }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); } $(function(){ //创建管理员删除的弹出层 $('#admin_article_del').click(function(){ $.cover(false); asyncbox.open({ id : 'class_thickbox', html : '<div class="HT_layer3_1"><ul><li class="HT_li1">操作原因:<select class="HT_sel7" id="del_type" name="del_type"><option value="广告文章">广告文章</option><option value="违规内容">违规内容</option><option value="标题不明">标题不明</option><option value="文不对题">文不对题</option></select></li><li class="HT_li1" ><input class="HT_btn4" id="admin_delete" type="button" /></li></ul></div>', title : '选择类型', width : 300, height : 150, scroll : 'no', callback : function(action){ if(action == 'close'){ $.cover(false); } } }); }); $('#admin_delete').live('click' , function(){ ///blog/logicdel/id/3480184/url/%252Fblog%252Findex.html.html var type = $('#del_type').val(); var url = '/blog/logicdel/id/2044971/url/%252Fuid%252F7741341.html.html'; window.location.href= url + '?type=' + type; }); //顶 js中暂未添加&过滤 $('#digg').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $('#digg').attr('bid'); var url = $('#digg').attr('url'); var digg_str = $.cookie('digg_id'); if(digg_str != null) { var arr= new Array(); //定义一数组 arr = digg_str.split(","); //字符分割 for( i=0 ; i < arr.length ; i++ ) { if(bid == arr[i]) { showErrorMsg('已经赞过该文章', '消息提示'); return false; } } } $.ajax({ type:"POST", url:url, data: { 'bid' : bid }, dataType: 'json', success:function(msg){ if(msg.error == 0) { var num = parseInt($('#digg_num').html(),10); num += 1; $('#digg_num').html(num); $('#digg').die(); if(digg_str == null) { $.cookie('digg_id', bid, {expires: 30 , path: '/'}); } else { $.cookie('digg_id', digg_str + ',' + bid, {expires: 30 , path: '/'}); } showSucceedMsg('谢谢' , '消息提示'); } else if(msg.error == 1) { //showErrorMsg(msg.error_content , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); } else if(msg.error == 2) { showErrorMsg(msg.error_content , '消息提示'); } } }); }); //举报弹出层 /*$('.box_report').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var url = $('#report_url').val(); var cid = $(this).attr('cid'); $.cover(false); asyncbox.open({ id : 'report_thickbox', url : url, title : '举报违规', width : 378, height : 240, scroll : 'no', data : { 'cid' : cid, 'idtype' : 2 }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); });*/ //评论相关代码 //点击回复显示评论框 $('.Blog_a10').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } if(allowComment == 1) { showErrorMsg('该博文不允许评论' , '消息提示'); return false; } var tid = $(this).attr('toid');//留言作者id var bid = $(this).attr('bid');//blogid var cid = $(this).attr('cid');//留言id var tname = $(this).attr('tname'); var tpl = '<div class="Blog_right1_9">'; tpl += '<div class="div2">'; tpl += '<textarea name="" cols="" rows="" class="Blog_ar1_1" id="rmsg">文明上网,理性发言...</textarea>'; tpl += '</div>'; tpl += '<div class="div3">'; tpl += '<div class="div3_2"><a href="javascript:void(0);" class="Blog_a11" id="quota_sbumit" url="/Comment/PostComment.html" tid="'+tid+'" bid="'+bid+'" cid="'+cid+'" tname="'+tname+'" ></a><a href="javascript:void(0)" id="qx_comment" class="Blog_a12"></a></div>'; tpl += '<div class="div3_1"><a href="javascript:void(0);" id="mface"><span></span>表情</a></div>'; tpl += '<div class="clear"></div>'; tpl += '</div>'; tpl += '</div>'; $('.z_move_comment').html(''); $(this).parents('.Blog_right1_8').find('.z_move_comment').html(tpl).show(); }); //引用的评论提交 $('#quota_sbumit').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $(this).attr('bid'); var tid = $(this).attr('tid');//被引用人的id var qid = $(this).attr('cid');//引用的id var url = $(this).attr('url'); var text = $('#rmsg').val(); var tname = $(this).attr('tname'); if(text == '' || text=='文明上网,理性发言...') { showErrorMsg('评论内容不能为空!' , '消息提示'); return false; } else { if(mb_strlen(text) > 1000){ showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); return false; } } $.ajax({ type: "post", url: url , data: {'bid': bid , 'to' : tid , 'qid' : qid , 'text': text , 'tname' : tname }, dataType: 'json', success: function(data){ if(data.code == 1){ var tpl = '<div class="Blog_right1_8">'; tpl+= '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>'; tpl+= '<div class="Blog_right_font1">'; tpl+= '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>'; tpl+= '<p class="Blog_p7"><a href="' + data.info.quota.url + '">' + data.info.quota.username + '</a>:'+ data.info.quota.content + '</p>'; tpl+= '<p class="Blog_p8">' + data.info.content + '</p><span class="span_text1"><a href="javascript:void(0);" class="Blog_a10" toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + ' tname = ' + data.info.username + ' >回复</a> |  <a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '" >删除</a> |  <a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '" >举报</a></span></div>'; tpl+= '<div class="z_move_comment" style="display:none"></div>'; tpl+= '<div class="Blog_line1"></div></div>'; $('#replyList .Blog_right1_8:first').before(tpl); $('.z_move_comment').html('').hide(); } else if(data.code == -1){ //showErrorMsg(data.info , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); } }, error: function(){//请求出错处理 } }); }); //底部发表评论 $('#submitmsg').click(function(){ if(allowComment == 1) { showErrorMsg('该博文不允许评论' , '消息提示'); return false; } var bid = $(this).attr('bid'); var toid = $(this).attr('toid'); var text = $('#reply').val(); var url = $(this).attr('url'); if(text == '' || text=='文明上网,理性发言...') { showErrorMsg('评论内容不能为空!' , '消息提示'); return false; } else { if(mb_strlen(text) > 1000){ showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); return false; } } $.ajax({ type: "post", url: url , data: {'bid': bid , 'to' : toid ,'text': text}, dataType: 'json', success: function(data){ if(data.code == 1) { var tpl = '<div class="Blog_right1_8">'; tpl += '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>'; tpl += '<div class="Blog_right_font1">'; tpl += '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>'; tpl += '<p class="Blog_p6">' + data.info.content + '</p>'; tpl += '<div class="div1"><a href="javascript:void(0);" class="Blog_a10" toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + '>回复</a> |  <a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '">删除</a> |  <a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '">举报</a></div>'; tpl += '<div class="z_move_comment" style="display:none"></div>'; tpl += '</div><div class="Blog_line1"></div></div>'; $('.Blog_tit3:first').after(tpl); $('#reply').val('文明上网,理性发言...'); } else if(data.code == -1) { showErrorMsg(data.info , '消息提示'); } }, error: function(){//请求出错处理 } }); }); //底部评论重置 $('#reset_comment').click(function(){ $('#reply').val('文明上网,理性发言...'); }); //取消回复 $('#qx_comment').live('click' , function(){ $('.z_move_comment').html('').hide(); }); $('#rmsg, #reply').live({ focus:function(){ if($(this).val() == '文明上网,理性发言...'){ $(this).val(''); } }, blur:function(){ if($(this).val() == ''){ $(this).val('文明上网,理性发言...'); } } }); //删除留言确认 $('.comment_del_mark').live('click' , function(){ var url = $(this).attr('url'); asyncbox.confirm('删除留言','确认', function(action){ if(action == 'ok') { location.href = url; } }); }); //删除时间确认 $('.del_article_id').click(function(){ var delurl = $(this).attr('delurl'); asyncbox.confirm('删除文章','确认', function(action){ if(action == 'ok') { location.href = delurl; } }); }); /* //字数限制 $('#rmsg, #reply').live('keyup', function(){ var id = $(this).attr('id'); var left = Util.calWbText($(this).val(), 500); var eid = '#errmsg'; if(id == 'reply') eid = '#rerrmsg'; if (left >= 0) $(eid).html('您还可以输入<span>' + left + '</span>字'); else $(eid).html('<font color="red">您已超出<span>' + Math.abs(left) + '</span>字 </font>'); }); */ //加载表情 $('#face').qqFace({id : 'facebox1', assign : 'reply', path : '/image/qqface/'}); $('#mface').qqFace({id : 'facebox', assign : 'rmsg', path:'/image/qqface/'}); /* $('#class_one_id').change(function(){ alert(123213); var id = parseInt($(this).val() , 10); if(id == 0) return false; $('.hidden_son_class span').each(function( index , dom ){ if( dom.attr('cid') == id ) { } }); }); */ //转载文章 var turn_url = "/blog/viewClassPart.html"; $('#repost_bar').click(function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var id = $(this).attr('bid'); asyncbox.open({ id : 'turn_class_thickbox', url : turn_url, title : '转载文章', width : 330, height : 131, scroll : 'no', data : { 'id' : id }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); }); /* //转发文章 $('#repost_bar').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $(this).attr('bid'); var url = $(this).attr('url'); asyncbox.confirm('转载文章','确认', function(action){ if(action == 'ok'){ $.ajax({ type:"POST", url:url, data: { 'bid' : bid }, dataType: 'json', success:function(msg){ if(msg.error == 0){ showSucceedMsg('转发成功!', '消息提示'); }else if(msg.error == 1){ //location.href = '/index.php?r=site/login'; showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); }else{ showErrorMsg(msg.error_content, '消息提示'); } } }); } }); }); */ }); </script> <!--该部分应该放在输出代码块的后面才起作用 --> <script type="text/javascript"> SyntaxHighlighter.autoloader( 'applescript /highlight/scripts/shBrushAppleScript.js', 'actionscript3 as3 /highlight/scripts/shBrushAS3.js', 'bash shell /highlight/scripts/shBrushBash.js', 'coldfusion cf /highlight/scripts/shBrushColdFusion.js', 'cpp c /highlight/scripts/shBrushCpp.js', 'c# c-sharp csharp /highlight/scripts/shBrushCSharp.js', 'css /highlight/scripts/shBrushCss.js', 'delphi pascal /highlight/scripts/shBrushDelphi.js', 'diff patch pas /highlight/scripts/shBrushDiff.js', 'erl erlang /highlight/scripts/shBrushErlang.js', 'groovy /highlight/scripts/shBrushGroovy.js', 'java /highlight/scripts/shBrushJava.js', 'jfx javafx /highlight/scripts/shBrushJavaFX.js', 'js jscript javascript /highlight/scripts/shBrushJScript.js', 'perl pl /highlight/scripts/shBrushPerl.js', 'php /highlight/scripts/shBrushPhp.js', 'text plain /highlight/scripts/shBrushPlain.js', 'py python /highlight/scripts/shBrushPython.js', 'ruby rails ror rb /highlight/scripts/shBrushRuby.js', 'scala /highlight/scripts/shBrushScala.js', 'sql /highlight/scripts/shBrushSql.js', 'vb vbnet /highlight/scripts/shBrushVb.js', 'xml xhtml xslt html /highlight/scripts/shBrushXml.js' ); SyntaxHighlighter.all(); function code_hide(id){ var code = document.getElementById(id).style.display; if(code == 'none'){ document.getElementById(id).style.display = 'block'; }else{ document.getElementById(id).style.display = 'none'; } } </script> <!--回顶部js2011.12.30--> <script language="javascript"> lastScrollY=0; function heartBeat(){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop else {/*Netscape stuff*/} percent=.1*(diffY-lastScrollY); if(percent>0)percent=Math.ceil(percent); else percent=Math.floor(percent); document.getElementById("full").style.top=parseInt(document.getElementById("full").style.top)+percent+"px"; lastScrollY=lastScrollY+percent; if(lastScrollY<200) { document.getElementById("full").style.display="none"; } else { document.getElementById("full").style.display="block"; } } var gkuan=document.body.clientWidth; var ks=(gkuan-960)/2-30; suspendcode="<div id=\"full\" style='right:-30px;POSITION:absolute;TOP:500px;z-index:100;width:26px; height:86px;cursor:pointer;'><a href=\"javascript:void(0)\" onclick=\"window.scrollTo(0,0);\"><img src=\"\/image\/top.png\" /></a></div>" document.write(suspendcode); window.setInterval("heartBeat()",1); </script> <!-- footer --> <div class="Blog_footer" style='clear:both'> <div><a href="http://www.chinaunix.net/about/index.shtml" target="_blank" rel="nofollow">关于我们</a> | <a href="http://www.it168.com/bottomfile/it168.shtml" target="_blank" rel="nofollow">关于IT168</a> | <a href="http://www.chinaunix.net/about/connect.html" target="_blank" rel="nofollow">联系方式</a> | <a href="http://www.chinaunix.net/about/service.html" target="_blank" rel="nofollow">广告合作</a> | <a href="http://www.it168.com//bottomfile/flgw/fl.htm" target="_blank" rel="nofollow">法律声明</a> | <a href="http://account.chinaunix.net/register?url=http%3a%2f%2fblog.chinaunix.net" target="_blank" rel="nofollow">免费注册</a> <p>Copyright 2001-2010 ChinaUnix.net All Rights Reserved 北京皓辰网域网络信息技术有限公司. 版权所有 </p> <div>感谢所有关心和支持过ChinaUnix的朋友们 <p><a href="http://beian.miit.gov.cn/">16024965号-6 </a></p> </div> </div> </div> </div> <script language="javascript"> //全局错误提示弹出框 function showErrorMsg(content, title, url){ var url = url || ''; var title = title || '消息提示'; var html = ''; html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span1"></span>' + content + '</p></li>'; if(url == '' || url.length == 0){ html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick=\'close_windows("error_msg")\'></li>'; } else { html += '<li class="HT_li1"><input type="button" class="login_btn1" onclick="location.href=\'' + url + '\'"></li>'; } html += '</ul></div>'; $.cover(true); asyncbox.open({ id: 'error_msg', title : title, html : html, 'callback' : function(action){ if(action == 'close'){ $.cover(false); } } }); } //全局正确提示 function showSucceedMsg(content, title , url ){ var url = url || ''; var title = title || '消息提示'; var html = ''; html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span2"></span>' + content + '</p></li>'; if(url == '' || url.length == 0){ html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick=\'close_windows("error_msg")\'></li>'; } else { html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick="location.href=\'' + url + '\'"></li>'; } html += '</ul></div>'; $.cover(true); asyncbox.open({ id: 'error_msg', title : title, html : html, 'callback' : function(action){ if(action == 'close'){ $.cover(false); } } }); } //关闭指定id的窗口 function close_windows(id){ $.cover(false); $.close(id); } //公告 var tID; var tn; // 高度 var nStopTime = 5000; // 不同行间滚动时间隔的时间,值越小,移动越快 var nSpeed = 50; // 滚动时,向上移动一像素间隔的时间,值越小,移动越快 var isMove = true; var nHeight = 25; var nS = 0; var nNewsCount = 3; /** * n 用于表示是否为第一次运行 **/ function moveT(n) { clearTimeout(tID) var noticev2 = document.getElementById("noticev2") nS = nSpeed; // 只在第一次调用时运行,初始化环境(有没有参数) if (n) { // 设置行高 noticev2.style.lineHeight = nHeight + "px"; // 初始化显示位置 tn = 0; // 刚进入时在第一行停止时间 nS = nStopTime; } // 判断鼠标是否指向层 if (isMove) { // 向上移动一像素 tn--; // 如果移动到最下面一行了,则移到顶行 if (Math.abs(tn) == nNewsCount * nHeight) { tn = 0; } // 设置位置 noticev2.style.marginTop = tn + "px"; // 完整显示一行时,停止一段时间 if (tn % nHeight == 0) { nS = nStopTime; } } tID = setTimeout("moveT()", nS); } moveT(1); // 此处可以传入任何参数 </script> <script type="text/javascript"> // var _gaq = _gaq || []; // _gaq.push(['_setAccount', 'UA-20237423-2']); // _gaq.push(['_setDomainName', '.chinaunix.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); // })(); </script> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0ee5e8cdc4d43389b3d1bfd76e83216b' type='text/javascript'%3E%3C/script%3E")); function link(t){ var href= $(t).attr('href'); href+="?url="+encodeURIComponent(location.href); $(t).attr('href',href); //setCookie("returnOutUrl", location.href, 60, "/"); } </script> </body> </html>