JavaScript实现类似Excel功能
//复制所选表格的数据到剪贴板 作者:xx
function copyData(){
var content = "";
var tbl = getTbl();
//获取所选的所有数据
for(j = start_Row; j <= end_Row; j++)
{
for(i = start_Col; i <= end_Col; i++)
{
content += (tbl.rows[j].cells[i].childNodes[0].value);
if(i != end_Col) content += String.fromCharCode(9);
}
content += "\n";
}
try
{
//赋值到剪贴板
clipboardData.setData('text',content);
}catch(e)
{
alert('error:' + e);
}
}
相关文档:
/***************************by
garcon1986********************************/
感谢CSDN的shan1119 帮我解决Javascript部分的错误。
<mce:script language="JavaScript"><!--
function toggle(id,id2,id3) {
var state = document.getElementById(id).style.display;
if (state == 'block') {
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charse ......
<script language="JavaScript">
<!--
//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
//参数(图片,允许的宽度,允许的高度)
var image=new Image();
image.src=ImgD.src; ......
浏览器:IE 8、FF 3.6、Chrome 4.0、Safari 4.0、Opera 10.1
仅有IE浏览器支持HTMLElement.onresize(比如body.onresize)
其它浏览器只支持window.onresize
先说IE的HTMLElement.onresize
使用前请确定你的心脏及血压正常,如果你定义了
body.onresize = function(){……}或者html.onresize = obj.fun;
......