下载

0下载券

加入VIP
  • 专属下载券
  • 上传内容扩展
  • 资料优先审核
  • 免费资料无限下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 用SSH+ajax实现的上传进度条,仿qq邮箱的大文件上传窗体

用SSH+ajax实现的上传进度条,仿qq邮箱的大文件上传窗体.doc

用SSH+ajax实现的上传进度条,仿qq邮箱的大文件上传窗体

论语之王子牛仔
2017-09-18 0人阅读 举报 0 0 0 暂无简介

简介:本文档为《用SSH+ajax实现的上传进度条,仿qq邮箱的大文件上传窗体doc》,可适用于项目管理领域

用SSHajax实现的上传进度条,仿qq邮箱的大文件上传窗体用SSHajax实现的上传进度条,仿qq邮箱的大文件上传窗体用SSHajax实现的上传进度条,仿邮箱的大文件上传窗体使用说明:,界面显示:直接调用sAlerttxttxt是参数。,后台支持:varurl"progressdo"这一句是后台action的名称。所以必须在服务器端有这个action。当然你也可以改掉这个URL。net,asp,和jsp可以相应的改掉这个urL即可。另外在后台的服务类里,写回应的XML的时候必须包括以下三个标签值,,值,值以下为JavaScript。scripttype"textjavascript"language"javascript"varcountByte"B"varicountBytevarreadByte"B"varireadBytevarspeed"bs"varispeedvarpgs""varivarldatenewDatevardatenewDatevarxmlHttpvarkeyfunctionsAlerttxtiifwindowActiveXObjectxmlHttpnewActiveXObject"MicrosoftXMLHTTP"elseifwindowXMLHttpRequestxmlHttpnewXMLHttpRequestvareSrcdocumentallElement:argumentsvarshielddocumentcreateElement"DIV"shieldid"shield"ition"absolute"t"px">"px"th""ghtollHeightentHeight:ollHeight"px"kground"#"tAlign"center"dex""ter"alphaopacity"cityvaralertFramdocumentcreateElement"DIV"alertFramid"alertFram"ition"absolute"t""""ginLeft"px"ginTopollTop"px"th"px"ght"px"kground"#fff"tAlign"center"eHeight"px"dex""strHtml"ulstyle"liststyle:nonemargin:pxpadding:pxwidth:px""strHtml"listyle"background:#BBBtextalign:leftpaddingleft:pxfontsize:pxfontweight:boldheight:pxlineheight:pxborder:pxsolid#BBB"文件上传"strHtml"listyle"background:#ffftextalign:leftpaddingleft:pxpaddingtop:pxfontsize:pxheight:pxlineheight:pxborderleft:pxsolid#BBBborderright:pxsolid#BBB""txt""strHtml"listyle"background:#ffftextalign:centerpaddingtop:pxfontsize:pxheight:pxlineheight:pxborderleft:pxsolid#BBBborderright:pxsolid#BBB"tableid"pbar"width""height""border""cellspacing""cellpadding""bordercolor"#BBB"tablewidth""border""cellspacing""cellpadding""tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"tdid"l"divid"progress"文件总量:"countByte"已上传:"readByte"上传速度:"speed"上传进度:"pgs"n"strHtml"listyle"background:#CEBtextalign:rightpaddingright:pxfontweight:boldheight:pxlineheight:pxborder:pxsolid#BBB"inputtype"button"value"确定"id"doOK"onclick"doOk"inputtype"button"value"取消"id"doCancle"onclick"doCancle"n"strHtml"n"alertFraminnerHTMLstrHtmlendChildalertFramendChildshieldthissetOpacityfunctionobj,opacityifopacityopacityopacitytrycityopacitycatchegthobjfilters"alpha"objfilters"alpha"opacityopacity*ter"alphaopacity""opacity*"""catchevarcthisdoAlphafunctionifcclearIntervaladreturnsetOpacityshield,cvaradsetInterval"doAlpha",thisdoOkfunctionplay"none"play"none"oveChildalertFramoveChildshieldeSrcfocusvarurl"progressdo"xmlHttpopen"post",url,truexmlHttpsendelectstartfunctionreturntrueontextmenufunctionreturntruethisdoCanclefunctionoveChildalertFramoveChildshieldeSrcfocuselectstartfunctionreturntrueontextmenufunctionreturntruedocumentgetElementById"doOK"focuseSrcblurxmlHttponreadystatechangeshowprogresselectstartfunctionreturnfalseontextmenufunctionreturnfalsefunctionshowprogressvarurl"progressdo"xmlHttpopen"post",url,truexmlHttponreadystatechangeupdatexmlHttpsetRequestHeader"IfModifiedSince",""xmlHttpsendfunctionupdatetryifxmlHttpreadyStateifxmlHttpstatusvarfilelegthElementsByTagName"filelength"firstChilddatavarreadbytesElementsByTagName"readbytes"firstChilddatavarpgsElementsByTagName"pgs"firstChilddatavaripreadByteparseIntreadbytesvaripcountByteparseIntfilelegth文件长度单位转化ifipcountByte**countBytesubnumberipcountByte**,,"GB"elseifipcountByte*countBytesubnumberipcountByte*,,"MB"elseifipcountBytecountBytesubnumberipcountByte,,"KB"elsecountByteipcountByte"B"已上传长度单位转化ifipreadByte**readBytesubnumberipreadByte**,,"GB"elseifipreadByte*readBytesubnumberipreadByte*,,"MB"elseifipreadBytereadBytesubnumberipreadByte,,"KB"elsereadByteipreadByte"B"速度单位转化varispeedipreadByteireadByteifispeed**speedsubnumberispeed**,,"GBs"elseifispeed*speedsubnumberispeed*,,"MBs"elseifispeedspeedsubnumberispeed,,"KBs"elsespeedispeed"Bs"ireadByteipreadByte保存上次的上传量icountByteipcountByte保存文件长度pgspgs更新进度,在服务端进行了计算得到varunitsicountByte分割文件为份,为单元格的个数varmodunitsireadByteunits这两句varreadunitsireadBytemodunitsunits是用来计算整除,好显示出来foriireadunitsifor循环是用来更新图片的。用for可以防止漏画documentgetElementById"l"kgroundColor"#ADD"catcherralerterrname":"errmessage""xmlHttpreadyStatevarprogress"文件总量:"countByte"已上传:"readByte"上传速度:"speed"上传进度:"pgs""documentgetElementById"progress"innerHTMLprogresssetTimeout"showprogress",functionsubnumbernumber,start,endvarSnumbernumber""SnumberSnumbersubstringstart,endreturnnewNumberSnumber

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/7

VIP

意见
反馈

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利