<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="kikimail.WebForm1" %><!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 runat="server">
<title></title>
<script type="text/javascript">
function GroupTableCreat() {
var divt = document.getElementById("divUserGroup");
var tablet = "<table cellspacing='0' rules='all' border='0' id='grvContent2' style='position:relative;left:45pt;border-width:0px;width:80%;border-collapse:collapse;'><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk0' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk1' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk2' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk3' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk4' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk5' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk6' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk7' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk8' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk9' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk10' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk11' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr></table>";
divt.appendChild(tablet);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr><td><input type="button" value="copy" onclick="GroupTableCreat();" /></td></tr>
</table>
</div>
<div>
<table cellspacing='0' rules='all' border='0' id='grvContent' style='position:relative;left:45pt;border-width:0px;width:80%;border-collapse:collapse;'><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk0' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk1' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk2' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk3' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk4' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk5' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk6' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk7' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk8' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk9' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk10' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk11' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr></table>
</div>
<div id="divUserGroup">
</div>
</form>
</body>
</html>
代码如上,点击copy按钮时抱错;
需要追加的table显示是没有任何问题的,但是往div中添加就嫁不上去,抱错了
解决方案 »
- fckeditor域名访问上传问题..困绕了太久了.大家都来捧捧场吧
- 求一个正则表达式,请帮忙
- 很简单的js,在线等,马上给分
- 关于"abc-数字1;bcd-123;kkj-dfj;汉字-a"的正则
- 晕死,急:document.form1.mobile_model.insertAdjacentHTML("beforeEnd","<option value=xx"+models[j]+">"+models[j]+"</option>");
- 如何做字幕滚动效果?
- 怎么获得表格里面的内容?
- 看看吧!简单的!
- 请教一个新手问题
- 关于获取页面元素的正则表达式
- 为什么安装aptana插件后.Myeclipse总是弹出这个消息框
- 图片特效
var divt = document.getElementById("divUserGroup");
var tablet = "<table cellspacing='0' rules='all' border='0' id='grvContent2' style='position:relative;left:45pt;border-width:0px;width:80%;border-collapse:collapse;'><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk0' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk1' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk2' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk3' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk4' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk5' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk6' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk7' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr><tr class='t_row_bg'><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk8' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk9' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk10' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td><td class='Cell_Normal' align='center' style='width:5%;'><input type='checkbox' name='chk11' /></td><td class='Cell_Normal' align='left' style='width:15%;'>on</td></tr></table>";
var wrap = document.createElement("div");
wrap.innerHTML = tablet;
var tab = wrap.childNodes;
divt.appendChild(tab[0]);
}
改成
divt.innerHTML=tablet;
试试