js文件格式校验
来源:互联网 发布:飞天侠cms破解版 编辑:程序博客网 时间:2024/06/05 09:37
<
html
>
<
head
>
<
title
>js校验文件格式</
title
>
<
meta
http-equiv
=
'content-type'
content
=
'text/html;charset=utf-8'
>
<
script
type
=
"text/javascript"
src
=
"jquery-1.4.3.js"
></
script
>
<
script
type
=
"text/javascript"
>
function get(){
var s = $("#file1").val();
var fl = s.split(".");
//常用的文件格式
var ary = ["doc","docx","xls","xlsx","ppt","gif","jpeg","jpg","png","txt","wps","pdf"];
//文件格式在数组中返回下标,否则返回 -1
var t= $.inArray(fl[1],ary);
return t==-1;
}
</
script
>
</
head
>
<
body
>
<
input
type
=
"file"
id
=
"file1"
>
<
input
type
=
"button"
onclick
=
"get();"
value
=
"文件格式"
>
</
body
>
</
html
>
0 0
- js文件格式校验
- 校验wav文件格式
- Hex文件格式及其校验算法
- 利用xsd校验xml文件格式
- 图片字节转换 文件格式校验
- JS 校验
- js校验
- js校验
- js 校验
- js校验
- JS校验
- js校验
- js 校验
- JS 身份证号校验 年龄校验
- js手机号码校验,邮箱校验
- myeclipse中xml文件格式的校验
- JS验证文件格式
- JS验证文件格式
- java并发-独占锁与共享锁
- php ci 批量插入
- ORACLE查询优化及gather_plan_statistics hint
- 数据结构ds答案
- php 表单提交字段验证 字段值验证 自定义方法
- js文件格式校验
- linux修改主机名的方法
- android Intent机制详解
- 虚拟机VMware-workstation-full-11.0.0安装ubuntu-14.10-desktop-amd64.iso遇到问题
- android sdk manager无法更新 解决办法
- Linux 中将VIM改装成强大C的IDE
- 郭彦儒-提升移动音乐服务的竞争力
- mysql删除重复记录,但是要保留其中一条
- android自动连接wifi——WifiManager