去除首尾空格的公用方法
String.prototype.trim = function() {return (this.replace(/^\s+|\s+$/g,""));}//调用方法function check(){var fn = document.getElementById("fileName").value;document.getElementById("fileName").value = fn.trim();}