function Checkimgtype (this_) {var filepath=$ (This_). Val (); var extstart=filepath.lastindexof ("."); var ext=filepath.substring (extstart,filepath.length). toUpperCase (); if (ext!= ". PNG "&&ext!=". GIF "&&ext!=". JPG ") {alert (" image is limited to png,gif,jpg format "); $ (THIS_). focus (); if ($.browser.msie) {//Judge browser this_.select (); Document.execcommand ("delete"); }else{$ (This_). Val (""); } return false; } var file_size = 0; if ($.browser.msie) {var img=new Image (); Img.src=filepath; if (Img.filesize > 0) {if (img.filesize>3*1024) {alert ("The picture is less than 3MB. "); $ (this_). focus (); This_.select (); Document.execcommand ("delete"); return false;} }} else {file_size = this_.files[0].size; Console.log (file_size/1024/1024 + "MB"); var size = file_size/1024; alert (size), if (Size > 3) {alert ("Upload file size cannot exceed 3m! "); $ (thIS_). focus (); $ (This_). Val (""); return false;} return true;}