var filePath = $.trim($('#filePath').val());
对于String对象的replace方法,表达式不加入g,则只替换第一个匹配,如果加入g,则替换所有匹配
var newFilPath = filePath.replace(/\\/g, '/')