发布于 2016-12-29 12:55:46 | 91 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Javascript教程,程序狗速度看过来!
JavaScript客户端脚本语言
Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<title>upload...</title>
<style>
#ui-upload-holder{ position:relative;width:60px;height:35px;border:1px solid silver; overflow:hidden;}
#ui-upload-input{ position:absolute;top:0px;right:0px;height:100%;cursor:pointer; opacity:0;filter:alpha(opacity:0);z-index:999;}
#ui-upload-txt{ position:absolute;top:0px;left:0px;width:100%;height:100%;line-height:35px;text-align:center;}
#ui-upload-filepath{ position:relative; border:1px solid silver; width:150px; height:35px; overflow:hidden; float:left;}
#ui-upload-filepathtxt{ position:absolute; top:0px;left:0px; width:100%;height:35px; border:0px; line-height:35px; }
.uploadlay{margin:200px; border:1px green solid; width:300px; height:200px; padding:10px; }
</style>
</head>
<body>
<div class="uploadlay">
<div id="ui-upload-filepath">
<input type="text" id="ui-upload-filepathtxt" class="filepathtxt" />
</div>
<div id="ui-upload-holder" >
<div id="ui-upload-txt">上传</div>
<input type="file" id="ui-upload-input" name="myfile" />
</div>
</div>
<script>
document.getElementById("ui-upload-input").onchange=function(){
document.getElementById("ui-upload-filepathtxt").value = this.value;
}
</script>
</body>
</html>