解决方案 »
- 求弹出新网页的方法,类似于广告的那种。
- 软件外包同盟——JAVA技术方向
- 高分请教,jquery问题,如何得到input file 的路径
- 表格某行单元格中文本框的值?
- 关于ani格式的鼠标样式问题
- 我遇到一个非常郁闷的ocx问题,大家帮忙看看
- 如何实现鼠标滚轮事件
- 层能不能盖过frame?
- 我正在学习JAVASCRIPT。有一段可以正常用的程序。可是我不懂它们的代码的意思?能请您指导吗?
- 请问版主:不会“把大家讨论一下EtCell报表控件/插件的功能,来者有分!“的贴子也给封杀了吧?
- 我把所有分都献出来了。,在线等答案。先谢谢各位 JS问题
- 12306 java 登陆 https://kyfw.12306.cn/otn/dynamicJs/lojzuyz
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
window.onload = function(){
var tb = document.getElementById("tb");
tb.appendChild("<tr><td>00010001</td><td>子目录-01</td><td>45.0</td><td>45.0</td></tr>");
tb.appendChild("<tr><td>00010002</td><td>子目录01-1</td><td>60.0</td><td>60.0</td></tr>");
}
</script>
</head>
<body>
<div align="center">
<p>电费统计报表</p>
<table width="400" border="0" id="tb">
<tr>
<th width="150">编码</th>
<th width="150">电表名称</th>
<th width="150">用电量</th>
<th width="150">金额</th>
</tr>
</table>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import ="java.util.*,com.ruixin.entity.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
window.onload = function(){
var tb = document.getElementById("tb");
<%
List reportList=(List)request.getAttribute("reportList");
for(int i=0;i<reportList.size();i++){
Report report=(Report)reportList.get(i);
%>
var tr=document.createElement('tr');
var td1=document.createElement('td');
var td2=document.createElement('td');
var td3=document.createElement('td');
var td4=document.createElement('td');
td1.innerText=<%=report.getCode()%>;
td2.innerText=<%=report.getName()%>;
td3.innerText=<%=report.getUseNum()%>;
td4.innerText=<%=report.getMoney()%>;
tr.appendChild(td1);
tr.appendChild(td2);
tr.appendChild(td3);
tr.appendChild(td4);
tb.appendChild(tr);
//////// tb.appendChild("<tr><td><%=report.getCode()%></td><td><%=report.getName()%></td><td><%=report.getUseNum()%></td><td><%=report.getMoney()%></td></tr>");
<%
}
%>
}
</script>
</head>
<body>
<div align="center">
<p>电费统计报表</p>
<table width="400" border="0" id="tb">
<tr>
<th width="150">编码</th>
<th width="150">电表名称</th>
<th width="150">用电量</th>
<th width="150">金额</th>
</tr>
</table>
</div>
</body>
</html>
<script type="text/javascript">
window.onload=function(){
var tb=document.getElementById('tb');
tb.appendChild("<tr><td>a</td><td>b</td><td>c</td><td>d</td></tr>");
//你可以试一下这种最简单的在table中动态添加td的方式,但是这明显是不行的,appendChild()中添加的应该是动态
//创建好的标签,而js中创建标签使用的是标签名称,例如:document.createElement('div'),并不是将div改为<div></div>
//document.createElement('<div></div>');有点类似于jquery中的$div=$("<div id='div1'></div>");,但是js并不支持这种
//动态创建标签的方式
}
</script>
<script type="text/javascript">
window.onload=function(){
var tb=document.getElementById('tb');
tb.appendChild("<tr><td>a</td><td>b</td><td>c</td><td>d</td></tr>");
//你可以试一下这种最简单的在table中动态添加td的方式,但是这明显是不行的,appendChild()中添加的应该是动态
//创建好的标签,而js中创建标签使用的是标签名称,例如:document.createElement('div'),并不是将div改为<div></div>
//document.createElement('<div></div>');有点类似于jquery中的$div=$("<div id='div1'></div>");,但是js并不支持这种
//动态创建标签的方式
}
</script>
嗯,知道了,谢谢解答