在博客上留言是一种美德,经常在博客上留言的朋友一定会觉得每次在博客上输入昵称,邮箱和网址是一件很烦人的事情,下面提供博客快速留言技巧。
我以目前两大主流博客程序WordPress和Zblog为例。首先打开任意博客的文章页面,查看源代码找到留言处,找到输入框的标签ID,在WordPress中你会看到这些标签ID:author email url comment 。
要说明的是这些标签ID在不同的WordPress主题可能有所不同。
下面看wordpress博客快速留言代码(评论中有改进代码)。
javascript:
(
function()
{
document.getElementById(‘author’).value=’溫暖色調’;
document.getElementById(’email’).value=’[email protected]’;
document.getElementById(‘url’).value=’https://blog.warmcolor.net’;
document.getElementById(‘comment’).value=’这里是你的留言’
}
)
()
getElementById中填写博客主题的标签ID,value中填写自己的信息。然后用浏览器任意收藏一个网页,修改名称为 WordPress博客快速留言,再将上面代码复制到地址保存。当你浏览WordPress博客时只需要点击一下收藏夹中的“WordPress博客快速 留言” 预先设置好的内容就自动填写好了。
应用相同的方法添加Zblog博客快速留言,Zblog博客快速留言代码如下
javascript:
(
function()
{
document.getElementById(‘inpName’).value=’溫暖色調’;
document.getElementById(‘inpEmail’).value=’[email protected]’;
document.getElementById(‘inpHomePage’).value=’https://blog.warmcolor.net’;
document.getElementById(‘txaArticle’).value=’这里是你的留言’
}
)
()
另外还可以直接将下面链接保存到收藏夹中,向我一样懒的bloger们快去试试吧!
WordPress博客快速留言 | Zblog博客快速留言
收藏夹方法:将代码中个人信息更改后,创建一个书签,网址为上述代码即可.
ZSJ代码整理如下:
javascript:(
function(){
document.getElementById(‘author’).value=’溫暖色調’;
document.getElementById(’email’).value=’[email protected]’;
document.getElementById(‘url’).value=’https://blog.warmcolor.net’;
document.getElementById(‘comment’).value=prompt(“请输入评论”,””);
document.getElementById(‘submit’).click();
}
)
()
注:确定后自动提交,暂时仅限wordpress
我觉得一般人上不同的博客留言一般不是发广告,留言不会一样。
不如用prompt代替固定的字符串。
javascript:{document.getElementById(‘author’).value=’ZSJ’;
document.getElementById(’email’).value=”[email protected]”;
document.getElementById(‘url’).value=”http://zhengshunjin.com.cn”;
document.getElementById(‘comment’).value=prompt(“这里是你的留言”);
document.getElementById(‘submit’).click();}
请问
javascript:{}
与
javascript:()
有什么区别?
貌似是漏掉了function
另外再问一下,你的域名怎么注册的?
我觉得没必要用匿名函数。
就是当时CN域名不值钱的时候就那样正常注册的,现在CN都严了。
你看看TK免费或收费域名也行。http://dot.tk
测试