当前位置: 首页 > 图文教程 > 网络编程 > ASP > PJ-Blog教程┊增强博客用户体验~让发表内容的同时拷贝到剪贴板以防丢失

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 PJ-Blog教程┊增强博客用户体验~让发表内容的同时拷贝到剪贴板以防丢失


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 230 ::
收藏到网摘: n/a

出处:异次元の世界 http://www.x-force.cn/article.asp?id=177

在修改任何文件前请先备份好!!!!以防万一!!!切记!!
1. 用编辑器打开common\common.js
2. 在代码里找到
//PBlog2 公用JS代码
//Author:PuterJam
在其后面添加:
/* 偶添加的拷贝发表内容到剪贴板函数,更多精彩请访问: */
//复制评论文本框
function copytext(){
document.all.Message.select();
document.execCommand("copy");
alert("您的发表的内容已经拷贝至剪贴板,丢失后可以使用Ctrl+V(粘贴)找回。\n\n更多精彩,欢迎访问<异次元の世界> ")
}
3. 打开class\cls_article.asp
4. 找到程序代码
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S"/>
修改为:
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S" onclick="copytext();"/>
5. 打开blogpost.asp,在里面找到
<input name="SaveArticle" type="submit" class="userbutton" value="提交日志" accesskey="S"/>
修改为:
<input name="SaveArticle" type="submit" class="userbutton" value="提交日志" accesskey="S" onclick="copytext();"/>
6. 打开Plugins\GuestBook\guestbook.asp,在里面找到
<input name="submit" type="submit" class="userbutton" value="<%if not replyMsg then%>发表留言<%else%>回复留言<%end if%>"/>
修改为:
<input name="submit" type="submit" class="userbutton" value="<%if not replyMsg then%>发表留言<%else%>回复留言<%end if%>" onclick="copytext();"/>
7. 打开blogedit.asp,找到下面的代码
<input name="SaveArticle" type="submit" class="userbutton" value="保存日志" accesskey="S"/>
<%if lArticle.logIsDraft then%>
<input name="SaveDraft" type="submit" class="userbutton" value="保存并取消草稿" accesskey="D" onclick="document.getElementById('log_IsDraft').value='False'"/>
修改为:
<input name="SaveArticle" type="submit" class="userbutton" value="保存日志" accesskey="S" onclick="copytext();"/>
<%if lArticle.logIsDraft then%>
<input name="SaveDraft" type="submit" class="userbutton" value="保存并取消草稿" accesskey="D" onclick="copytext();document.getElementById('log_IsDraft').value='False'"/>
  好了!现在发表新日志、编辑日志、发表评论、留言时均会把内容复制到剪贴板“以防万一”了~
为了方便懒人,免去自己改代码的麻烦,本站提供已修改好的文件打包下载
文件名称: CopyText.rar
文件大小: 25.5 KB
文件类型: RAR 压缩文档
http://filexoom.com/files/16687/DownLoad/CopyText.rar