日期:2014-05-16  浏览次数:20451 次

js 多文件上传
   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>

<script type="text/javascript">

function addMore()
{
var td = document.getElementById("more");

var br = document.createElement("br");
var input = document.createElement("input");
var button = document.createElement("input");

input.type = "file";
input.name = "file";

button.type = "button";
button.value = "Remove";

button.onclick = function()
{
td.removeChild(br);
td.removeChild(input);
td.removeChild(button);
}

td.appendChild(br);
td.appendChild(input);
td.appendChild(button);

}

</script>

</head>

<body>

<table align="center" width="50%">

</table>


<table align="center" width="50%" border="1">


<tr>
<td>
file
</td>

<td id="more">
<input type="file" name="file">
<input type="button" value="Add More.." onclick="addMore()">
</td>
</tr>


</table>


</body>

</html>


&   &amp;
<   &it;
>   &gt;
"   &quot;
'   &apos


Ext.PagingToolbar1 = Ext.extend(Ext.PagingToolbar, {
    doRefresh:function(){
        return false;
    }
});
Ext.reg('pagingtoolbar1', Ext.PagingToolbar1);


运行环境:
IE7。只有当IE7才会出现这样的问题,经测试IE8,firefox都是正常的。
问题描述:
项目需要用到了ext例子中的treegrid,有用过的朋友不值到有没有碰到过这样的问题,当列很多长度超过设的宽度时,就会出现水平滚动条,前提时不要设置treegrid的autoscroll属性,设置了会把外面panel的滚动条调出来。当你水平拖动的时候,是否会发现表头的背景是跟着在滚动,可是栏位的值却不会滚动。
解决过程:
在查找了源代码后,也试了一些方法都无济于事,而且还在源代码中设置表头滚动方法发现了这样的注释:
syncHeaderScroll : function(){
        var mb = this.innerBody.dom;
        this.innerHd.dom.scrollLeft = mb.scrollLeft;
        this.innerHd.dom.scrollLeft = mb.scrollLeft;
// second time for IE (1/2 time first fails, other browsers ignore)
    },
显然作者已经提醒我们水平滚动时会在IE中出现问题。最后试着采用重写表头的CSS样式来控制,在treegrid.CSS文件里面看到控制表头的样式,
.x-treegrid-header-inner {
    overflow: hidden;
    position:relative;
}


是直接查看了以前没问题的应用,其中doctype是怎么写的。发现新版本的eclipse gwt plugin,
自动生成的 html 里面 doctype是这样的:

<!doctype html>

而以前是的doctype是:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

直接把以前的doctype替换原来的doctype,就一切ok了。

细想了一下,其实替换doctype的方法,和smartgwt论坛上提出的增加meta信息,
目的都是一样的,就是不使用标准模式,而是把它变成Quirks模式。