var Url=new Object(); Url.test=function(str,type,retype){ var t=(retype==undefined || retype==""); if (type=="image"){ var reg=/^http(s)?:\/\/([\w-]+\.)+[\w-]+\/[\w-\.\/]*\.(jpg|gif|jpeg|png)$/; }else if (type=="swf"){ var reg=/^http(s)?:\/\/([\w-]+\.)+[\w-]+\/[\w-\.\/]*\.swf(\?[\w\-\=&%\\\/\.]*)?$/; } return (t)?reg.test(str):reg; } 应该是这个造成的