如何给Blog加上访问密码
Blogger小经验
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
任意处将以下JavaScript代码粘贴上
<script type="text/javascript">
/* Password Protection */
var password = 'password'
password=prompt('Please enter the password to enter this page:','');
if (password != 'password') {
location.href='http://blog.tomy168.com';
}
</script>
针对上面代码的红字部分,需要作以下修改,然后将页面发布后离开。
password 改为你自己设定的密码
http://blog.tomy168.com 改为你文章的地址
<script type="text/javascript">
/* Password Protection */
var password = 'password'
password=prompt('Please enter the password to enter this page:','');
if (password != 'password') {
location.href='http://blog.tomy168.com';
}
</script>
针对上面代码的红字部分,需要作以下修改,然后将页面发布后离开。
password 改为你自己设定的密码
http://blog.tomy168.com 改为你文章的地址
本方法摘录自:http://blog.tomy168.com
评论
发表评论