在网页head区域的标签中定义好的网页标题仍然可以在浏览时呈现不一样的内容,我们可以用JS脚本来实现网页标题的读取和修改等,以前就见到过这样的脚本知道有这个方法,今天在测试一个程序的时候要改动标题没有办法了才想到这个,只是不知道对搜索引擎有何影响。</p> <p>实现这种效果的基本代码是利用document.title来取得标题的值,如果要修改标题则可直接对document.title进行重新赋值就可以啦,下面给个利用这个写的一个动态标题的特效。</p> <p>[html]<script language=JavaScript><br />step=0<br />function flash_title()<br />{<br />step++<br />if (step==3) {step=1}<br />if (step==1) {document.title='微酷设计网 为您准备的总是最经典的 IPVV.CN'}<br />if (step==2) {document.title='微酷影院为您提供最轻松的娱乐空间 上千部电视大片随你看:vvDVD.cn'}<br />setTimeout("flash_title()",1600);<br />}<br />flash_title()<br /></script>[/html]</p> <div class='ujian-hook'></div><div style='clear:both;'></div> <script type="text/javascript" src="http://v1.ujian.cc/code/ujian.js"></script></div> </div><!--toolBar--> <div class="toolBar toolBarTwo"> <UL> <li class="mrinc2 tags2">Tags:<a href="https://vcoo.me/tag/js" rel="tag">js</a>,<a href="https://vcoo.me/tag/%e7%89%b9%e6%95%88" rel="tag">特效</a>,<a href="https://vcoo.me/tag/%e8%84%9a%e6%9c%ac" rel="tag">脚本</a></li> <LI class="mrinc2 share_r" onmouseover=share_more(750,this);><A href="javascript:;">分享到...</A> </LI> </UL> </div> <SCRIPT>postArray[750]=[];postArray[750][0]="[脚本]JS读取和修改网页标题";postArray[750][1]="https://vcoo.me/show/750.html";postArray[750][2]="在网页head区域的<title>标签中定义好的网页标题仍然可以在浏览时呈现不一样的内容,我们可以用JS脚本来实现网页标题的读取和修改等,以前就见到过这样的脚本知道有这个方法,今天在测试一个程序的...";postArray[750][3]="https://vcoo.me/wp-content/themes/MRuu2011/img/default.gif";</SCRIPT> </div> <div class="content_t_bot"><!--样式尾部--></div> </div> <div class="navigation"> <p class="navNew"><a href="https://vcoo.me/show/751.html" rel="next">[站务]微酷网络成功备案</a></p> <p class="navOld"><a href="https://vcoo.me/show/749.html" rel="prev">[日记]生日后声音记忆</a></p> </div> <!-- You can start editing here. --> <div id="comment_body"> <!-- If comments are open, but there are no comments. --> </div> <div class="navigation_comments"> <div class="pagination"></div> </div> <div id="respond"> <div class="excerpt_top"></div> <div class="excerpt_main"> <h3 class="givetext">发表评论</h3> <div class="cancel-comment-reply"> <!--<div id="real-avatar"> <img alt='' src='https://secure.gravatar.com/avatar/?s=40&d=identicon&r=g' srcset='https://secure.gravatar.com/avatar/?s=80&d=identicon&r=g 2x' class='avatar avatar-40 photo avatar-default' height='40' width='40' /> </div>--> <small><a rel="nofollow" id="cancel-comment-reply-link" href="/show/750.html#respond" style="display:none;">点击这里取消回复。</a></small> </div> <form action="https://vcoo.me/wp-comments-post.php" method="post" id="commentform"> <div class="form_box"> <div class="form_infobody"> <div id="comment-author-info" class="form_info"> <div class="author"><input type="text" class="textfield" name="author" id="author" tabindex="1" value=""></div> <p style="height:15px"></p> <div class="email"><input type="text" class="textfield" name="email" id="email" tabindex="2" value=""></div> <p style="height:15px"></p> <div class="url"><input type="text" class="textfield" name="url" id="url" tabindex="3" value=""></div> </div> </div> <div class="form_text"><textarea name="comment" id="comment" class="textarea" tabindex="4" onfocus="if (this.value == 'Make Comments on this Article') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Make Comments on this Article';}">评论是一群人的孤单……</textarea></div> </div> <p></p> <div class="ajax_box" id="comment_jstext"><a href="http://www.gravatar.com/" target="_blank">想要个全球通用头像? | 点击注册吧</a></div> <div class="form_btn"> <div class="submit_box"><div class="aLeft"><input class="submit" name="submit" type="submit" id="submit" tabindex="5" value="提交留言"><input class="reset" name="reset" type="reset" id="reset" tabindex="6" value="重写"></div><div class="aRight"><p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="318258c206" /></p><input type="checkbox" name="comment_mail_notify" id="comment_mail_notify" value="comment_mail_notify" checked="checked" style="margin-left:0px;" /><label for="comment_mail_notify" style="display: inline;">有人回复时邮件通知我</label><p style="display: none;"><input type="hidden" id="ak_js" name="ak_js" value="203"/></p> / 快捷键:Ctrl+Enter</label><input type='hidden' name='comment_post_ID' value='750' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </div></div> </div> <script type="text/javascript"> //Crel+Enter $(document).keypress(function(e){ if(e.ctrlKey && e.which == 13 || e.which == 10) { $(".submit").click(); document.body.focus(); } else if (e.shiftKey && e.which==13 || e.which == 10) { $(".submit").click(); } }) </script> </form> </div> <div class="excerpt_bot"></div> </div> </div> <div id="sidebar"> <!--日志分类--> <div class="sidebar_body"> <div class="sidebar_b_top"><!--样式头部--></div> <div class="sidebar_b_main"> <div class="sid_ify"> <div class="sid_ify_bg"> <H3>文章分类</H3> </div> </div> <div class="sid_body"> <ul class="sid_lm"> <li class="cat-item cat-item-3"><a href="https://vcoo.me/cat/life">生活心情</a> (826) </li> <li class="cat-item cat-item-4"><a href="https://vcoo.me/cat/computer">电脑技术</a> (216) </li> <li class="cat-item cat-item-91"><a href="https://vcoo.me/cat/website">建站编程</a> (129) </li> <li class="cat-item cat-item-44"><a href="https://vcoo.me/cat/soft">软件源码</a> (81) </li> <li class="cat-item cat-item-37"><a href="https://vcoo.me/cat/work">学习工作</a> (34) </li> <li class="cat-item cat-item-8"><a href="https://vcoo.me/cat/ent">影音娱乐</a> (126) </li> <li class="cat-item cat-item-10"><a href="https://vcoo.me/cat/news">网络资讯</a> (119) </li> <li class="cat-item cat-item-5"><a href="https://vcoo.me/cat/article">文摘评论</a> (59) </li> <li class="cat-item cat-item-132"><a href="https://vcoo.me/cat/photo">摄影相片</a> (38) </li> <li class="cat-item cat-item-223"><a href="https://vcoo.me/cat/webmaster">站长日志</a> (97) </li> <li class="cat-item cat-item-175"><a href="https://vcoo.me/cat/design">素材设计</a> (20) </li> <li class="cat-item cat-item-121"><a href="https://vcoo.me/cat/free">免费资源</a> (6) </li> <li class="cat-item cat-item-40"><a href="https://vcoo.me/cat/essay">唠叨随写</a> (23) </li> </ul> </div> </div> <div class="sidebar_b_bot"><!--样式尾部--></div> </div> <!--博客归档OR最新文章OR随机日志--> <div class="sidebar_body"> <div class="sidebar_b_top"><!--样式头部--></div> <div class="sidebar_b_main"> <div class="sid_ify"> <div class="sid_ify_bg"> <H3>最新文章</H3> </div> </div> <div class="sid_body"> <ul class="sid_Archives sid_link_text"> <li><a href="https://vcoo.me/show/2303.html" title="查看《又又又又换办公室了》">又又又又换办公室了</a></li><li><a href="https://vcoo.me/show/2298.html" title="查看《带闺女游济南野生动物世界》">带闺女游济南野生动物世界</a></li><li><a href="https://vcoo.me/show/2295.html" title="查看《老家的桃树开花了》">老家的桃树开花了</a></li><li><a href="https://vcoo.me/show/2288.html" title="查看《最近好忙碌,瞎折腾。》">最近好忙碌,瞎折腾。</a></li><li><a href="https://vcoo.me/show/2276.html" title="查看《改用 Directory Lister 搭建了微酷下载网站》">改用 Directory Lister 搭建了微酷下载网站</a></li><li><a href="https://vcoo.me/show/2271.html" title="查看《2018.5.20》">2018.5.20</a></li><li><a href="https://vcoo.me/show/2269.html" title="查看《恢复运动》">恢复运动</a></li><li><a href="https://vcoo.me/show/2261.html" title="查看《终于下决心将扁桃体切除了》">终于下决心将扁桃体切除了</a></li><li><a href="https://vcoo.me/show/2252.html" title="查看《今天心情不佳》">今天心情不佳</a></li><li><a href="https://vcoo.me/show/2240.html" title="查看《被暴雨困在路上》">被暴雨困在路上</a></li> </ul> </div> </div> <div class="sidebar_b_bot"><!--样式尾部--></div> </div> <!--最新留言--> <div class="sidebar_body"> <div class="sidebar_b_top"><!--样式头部--></div> <div class="sidebar_b_main"> <div class="sid_ify"> <div class="sid_ify_bg"> <H3>最新评论</H3> </div> </div> <div class="sid_body"> <ul class="sid_recent"> <li><img src='https://vcoo.me/avatar/d219af79b45e5891507fda4c4c2139a0.jpg'/><span class='rc_info'><span class='rc_name'>repostone</span> 评论道:<br /><a href="https://vcoo.me/show/2298.html#comment-7279" title="查看 带闺女游济南野生动物世界">玩一天无论如何算不错。</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/e8bfee2071ffa461cdde9c6c8ce29712.jpg'/><span class='rc_info'><span class='rc_name'>wjg1234</span> 评论道:<br /><a href="https://vcoo.me/show/1613.html#comment-5307" title="查看 [建站]Nginx环境下Typecho安装在子目录伪静态规则">子目录下安装Typecho, </a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/96c413433cd465560a045aad9e207c4b.jpg'/><span class='rc_info'><span class='rc_name'>YangJunwei</span> 评论道:<br /><a href="https://vcoo.me/show/2208.html#comment-4697" title="查看 再见朋友圈,再见QQ空间,回归自我">你这算是很有勇气的,大多时候我</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/b1dd946de21fd0ff200149dda2f549aa.jpg'/><span class='rc_info'><span class='rc_name'>张黎</span> 评论道:<br /><a href="https://vcoo.me/show/1802.html#comment-3105" title="查看 最近玩了下使命召唤9,感觉不错">召唤8和9都还没玩过</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/e2cb3ade69b0617d9139e14782d371dc.jpg'/><span class='rc_info'><span class='rc_name'>Tony</span> 评论道:<br /><a href="https://vcoo.me/show/1767.html#comment-3054" title="查看 最近VPS不给力 更换新主机商">我看你的VPS仍然在饭桶呢?</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/fe79f2e536c1ac83658557686f9c49bd.jpg'/><span class='rc_info'><span class='rc_name'>扒哥</span> 评论道:<br /><a href="https://vcoo.me/show/1783.html#comment-2856" title="查看 昂达V811开不了机卡在小白机器人那里">对平板无爱</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/4ad45fd4e606fc1e392e563d14583bd2.jpg'/><span class='rc_info'><span class='rc_name'>小米</span> 评论道:<br /><a href="https://vcoo.me/show/1760.html#comment-2734" title="查看 转到WP后垃圾评论明显得到控制">这样咱俩这模版一个样了 ~</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/920896374bf50c4fcd927a141c36c44f.jpg'/><span class='rc_info'><span class='rc_name'>淄川在线</span> 评论道:<br /><a href="https://vcoo.me/show/1753.html#comment-2720" title="查看 家里又停电了真可恶">我也是最不喜欢停电了,真的没发</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/4ad45fd4e606fc1e392e563d14583bd2.jpg'/><span class='rc_info'><span class='rc_name'>淄川朱小龙</span> 评论道:<br /><a href="https://vcoo.me/show/1732.html#comment-2693" title="查看 入手佳能单反600D一部">我晕 你真厉害 才买了尼康不久</a></li><div class=clear></div> <li><img src='https://vcoo.me/avatar/b1dd946de21fd0ff200149dda2f549aa.jpg'/><span class='rc_info'><span class='rc_name'>张黎</span> 评论道:<br /><a href="https://vcoo.me/about-vcoo#comment-2687" title="查看 关于微酷">支持你,不错噢</a></li><div class=clear></div> </ul> </div> </div> <div class="sidebar_b_bot"><!--样式尾部--></div> </div> <!--控制面板--> <div class="sidebar_body"> <div class="sidebar_b_top"><!--样式头部--></div> <div class="sidebar_b_main"> <div class="sid_ify"> <div class="sid_ify_bg"> <H3>控制面板</H3> </div> </div> <div class="sid_body"> <ul class="sid_Archives sid_link_text"> <li><a href="https://vcoo.me/wp-login.php">登录</a></li> </ul> </div> </div> <div class="sidebar_b_bot"><!--样式尾部--></div> </div> </div> <div class="clear"></div> </div> <!--中间内容End--> <!--尾部--> <div id="footer"> <div id="footerbar"> <p><span>微酷博客 Copyright © 2005-2012 www.vcoo.me All Rights Reserved.</span></p> <p><span><script language="javascript" type="text/javascript" src="https://js.users.51.la/1641054.js"></script></span><span>|</span><span><a href="http://www.vcoo.cc">微酷网络</a><span><span>|</span><span><a href="http://www.zibo.la" title="淄川信息港" target="_blank">淄川信息港</a><span><span>|</span><span><a href="/links/">友情链接</a><span><span>|</span><span><a href="/about-vcoo/">关于微酷</a></span><span>|</span><span>Powered by <a href="http://wordpress.org/" rel="external">WordPress</a></span><span>|</span><span>Theme Designed by <a href="http://blog.mruu.cn/" target="_blank">MinRui</a></span></p><script type='text/javascript' src='https://vcoo.me/wp-includes/js/comment-reply.min.js?ver=5.4.1'></script> <script type='text/javascript' src='https://vcoo.me/wp-includes/js/wp-embed.min.js?ver=5.4.1'></script> <script async="async" type='text/javascript' src='https://vcoo.me/wp-content/plugins/akismet/_inc/form.js?ver=4.1.4'></script> <script type="text/javascript" id="slb_context">/* <![CDATA[ */if ( !!window.jQuery ) {(function($){$(document).ready(function(){if ( !!window.SLB ) { {$.extend(SLB, {"context":["public","user_guest"]});} }})})(jQuery);}/* ]]> */</script> </div> </div> <!--尾部End--> <!-- QQ分享 Start <script language="javascript" type="text/javascript" src="https://www.vcoo.cc/web/static/js/QQShare.js"></script> QQ分享 End --> </div> <!-- BlogPet --> <div id="spig" class="spig"> <div id="message">加载中……</div> <div id="mumu" class="mumu"></div> <div > <!-- BlogPet End --> </body> </html>