我有一个JSP页面,我动态创建一个表数据.(我的页面只有表格,没有其他内容).
表中的行数可以达到1000s.
我正在做的是:在我写完整页后
<script>
function printPage(){
window.print();
}
</script>
Run Code Online (Sandbox Code Playgroud)
此代码可以正常工作以打印IE中的所有页面.但是当在Firefox中运行相同的代码时,它只打印第一页.可能的原因是什么?
最初我认为这可能与页面中的分页符有关,然后我也使用了它
<core:forEach var="result" items="${command.resultsList}" varStatus="counter">
<core:if test="${(counter.index + 1)%40 eq 0}">
<tr class="breakMe"></tr>
</core:if>
<tr>
code here
</tr>
</core:forEach>
Run Code Online (Sandbox Code Playgroud)
这样,表被分成40行的块,现在在IE中每页有40行,而在FF中它仍然是打印40行的第一页.可能的解决方案是什么?
我有一个条目servlet.xml,
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr
Run Code Online (Sandbox Code Playgroud)
现在,我认为,dwr是我们要使用的前缀,比如
<dwr:configuration>
<dwr:convert type="bean" class="com.abc.bean.MyBean" />
</dwr:configuration>
Run Code Online (Sandbox Code Playgroud)
现在问题是,如果网站http://www.directwebremoting.org关闭,那么我的应用程序无法创建bean.
每当beanfactory创建bean时,它会打到这个网站吗?
有没有其他选择,以便我可以使用dwr,而无需访问他们的网站?
完整标题:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
Run Code Online (Sandbox Code Playgroud) 我的应用程序实际上有数百页.现在我必须在onSubmit表单上附加一个事件'disablePage'.我不想去每一页写下:
<form name="frmname" onSubmit="disablePage();">
Run Code Online (Sandbox Code Playgroud)
我现在正在做的是: -
来自common.js文件的摘录; [包含在所有页面中]
/* we have to attach 'attachFormSubmit' method on onLoad event,
otherwise forms[0] will always be null. If there is any alternative,
then please suggest one */
if (window.addEventListener){
window.addEventListener('load', attachFormSubmit, false);
} else if (window.attachEvent){
window.attachEvent('onload', attachFormSubmit );
}
function attachFormSubmit(){
forms = document.getElementsByTagName('Form');
if ( forms[0] ){ // there is only one form in all pages
if (forms[0].addEventListener){
forms[0].addEventListener('submit', disablePage, false);
} else if (forms[0].attachEvent){
forms[0].attachEvent('onsubmit', disablePage);
}
}
}
function …Run Code Online (Sandbox Code Playgroud) 就像我们在 html 中包含一个 javascript 文件一样
<script language="JavaScript1.2" src="CommonFunctions.js" type="text/javascript">
Run Code Online (Sandbox Code Playgroud)
在这种情况下,'CommonFunctions.js' 被放置在当前目录中。我们可以在压缩文件中包含一个 javascript 文件吗?
我正在创建一个样本,其中我们将有四个块,当有人鼠标移过块时,它将向上滑动以显示其后面的内容,当mouseout事件发生时它将向下滑动.这就是我做的:
$(".garage span").hover(function(){
$(this).animate({'height':'0px'},1000);
//$(this).clearQueue().animate({'height':'0px'},1500);
}, function() {
$(this).animate({'height':'100px'},1000);
//$(this).clearQueue().animate({'height':'100px'},1500);
});
Run Code Online (Sandbox Code Playgroud)
HTML
<ul class="garage">
<li id="shutter1"><span>1</span></li>
<li id="shutter2"><span>2</span></li>
<li id="shutter3"><span>3</span></li>
<li id="shutter4"><span>4</span></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
问题是动画不愿意停止.原因是当块滑动时它会自动触发mouseout事件但是如何阻止它?
另外,让我知道如果我应该为它创建另一个问题,我想在跨度背后有一些文字.我不擅长CSS,所以请帮助我这样做.
在javascript中,我们如何检测表格的哪一行被单击?目前我正在做的是,我正在像这样在运行时绑定该方法。
onload = function() {
if (!document.getElementsByTagName || !document.createTextNode) return;
var rows = document.getElementById('my_table').getElementsByTagName('tbody')[0].getElementsByTagName('tr');
for (i = 0; i < rows.length; i++) {
rows[i].onclick = function() {
alert(this.rowIndex + 1);
}
}
}
Run Code Online (Sandbox Code Playgroud)
[复制自[ http://webdesign.maratz.com/lab/row_index/ ]]
但是我不喜欢这种方法。有没有其他选择?我的问题只是获取被单击的行的索引。
我正在使用TR的rowIndex属性,但它无法正常工作.如果我在这里做错了,请告诉我.
function myMethod(){
alert ( this.parent.rowIndex ); // parentNode is also used
}
Run Code Online (Sandbox Code Playgroud)
HTML
<table border="1">
<tr>
<td onclick="myMethod();">1.1</td>
<td>1.2</td>
<td>1.3</td>
</tr>
<tr>
<td onclick="myMethod();">2.1</td>
<td>2.2</td>
<td>2.3</td>
</tr>
<tr>
<td onclick="myMethod();">3.1</td>
<td>3.2</td>
<td>3.3</td>
</tr>
<tr>
<td onclick="myMethod();">4.1</td>
<td>4.2</td>
<td>4.3</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud) 我创建了一个测试程序,它创建了20个线程,然后这些线程将打开许多sql连接.让我们说你正在从eclipse执行这个程序,现在如果你将关闭eclipse.这会关闭所有打开的SQL连接吗?如果不是那么这些会发生什么?它会在数据库端显示100个打开的连接吗?如果是,那么在这种情况下该怎么办?
我只是测试了一些 CSS 转换(我是 CSS 初学者)。所有过渡都进展顺利。但在其中一个过渡中,当鼠标悬停完成时,过渡会顺利进行,而一旦您将鼠标移开,过渡就会突然结束。在所有其他情况下,鼠标悬停和鼠标移出都运行良好。
到底是什么原因导致转型以这样的方式结束呢?如何修复它?(已修复:感谢@Edwin)。现在,请解释为什么它在没有更改的情况下不起作用。
jsbin: http: //jsbin.com/oposof,http : //jsbin.com/oposof/5(我担心第一个过渡“三角形”)。
#container1 > div.triangle {
border-bottom: 80px solid red;
border-left: 60px solid transparent;
border-right: 60px solid transparent;
width: 0px;
height: 0px;
-webkit-transition: all 1.2s ease-in-out;
}
#container1 > div.triangle:hover {
border-top: 80px solid green;
border-left: 60px solid transparent;
border-right: 60px solid transparent;
}
#container1 > div.triangle:active {
border-left: 80px solid blue;
border-right: 60px solid transparent;
}
#container2 > div.testt {
color: red;
-webkit-transition: all 1s ease-in-out;
} …Run Code Online (Sandbox Code Playgroud)