<Script language="VBS">
Function getExtName(str)
if (len(str)<=4) then
getExtName = -1
else
getExtName = lcase(right(trim(str),4))
end if
End Function
</Script>
Function getExtName(str)
if (len(str)<=4) then
getExtName = -1
else
getExtName = lcase(right(trim(str),4))
end if
End Function
</Script>
解决方案 »
- html和xhtml之间的区别为什么在浏览器中没有作用
- input标签获取焦点时文本框内提示信息清空 火狐怎么实现
- javascript数组访问下标
- onkeydown问题
- FusionCharts 的3D饼图大小问题
- 求教高人,document.getElementById("game_eval").run
- *****************新人问问题*****************
- javascript有什么参考资料不,就像MSDN一样可以随时查看某函数的用法的等等
- 关于单选框的显示
- js时间增加的问题?
- 一个页面定义的javascript变量如何在另一个页面使用?
- onmouseover="image1.src=????怎么没有正常更换图片呀?
var ss="ddd.jsp"
ss.substring(ss.length-4)
<SCRIPT language="javascript">function getFilePostfix(oFile)
{
if(oFile == null)
return null;
if(oFile.value == null || oFile.value == "")
return null;
var arr = /(.*)\.(.*)$/gi.exec(oFile.value);
return RegExp.$2;
}function subForm()
{
alert(getFilePostfix(document.all.file1));
}
</SCRIPT>
<INPUT type="file" name="file1">
<INPUT type="button" value="check" onClick="subForm();">
<input type="button" value="Check" onclick="check()">
<script>
function check()
{
var filename = document.all.filename.value;
re = /^(.)*(.jsp)$/
alert(re.test(filename));
}
</script>