(未测)在IE耗时操作中加入进度条或进度框

加入进度条

this.Page.Response.Write("<div id='mydiv' >");
   this.Page.Response.Write("_");
   this.Page.Response.Write("</div>");
   this.Page.Response.Write("<script>mydiv.innerText = '';</script>");
   this.Page.Response.Write("<script language=javascript>;");
   this.Page.Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");
   this.Page.Response.Write("{var output; output = '正在查询,请稍后';dots++;if(dots>=dotmax)dots=1;");
   this.Page.Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText =  output;}");
   this.Page.Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");
   this.Page.Response.Write("window.setInterval('ShowWait()',1000);}");
   this.Page.Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';");
   this.Page.Response.Write("window.clearInterval();}");
   this.Page.Response.Write("StartShowWait();</script>");
   this.Page.Response.Flush();

 .........

   this.Page.Response.Write("<script language=javascript>HideWait();</script>");

加入进度框

this.Page.Response.Write("<script language=javascript>var win;win=window.open('_layouts/bluetech/loading.htm','progress','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=270,height=201,screenX='+(screen.width-270)/2+',screenY='+(screen.height-201)/2+',top='+(screen.height-201)/2+',left='+(screen.width-270)/2+'');</script>");
   this.Page.Response.Flush();
   ...........

   this.Page.Response.Write("<script language=javascript>win.close();</script>");


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/beichen_/archive/2009/03/13/3986540.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在小程序的onShareAppMessage处理耗时操作可能会导致分享操作的延迟或卡顿,因此需要注意处理方式。以下是一种常见的处理方式: 1. 首先,在onShareAppMessage,只做一些轻量级的操作,例如设置分享标题、路径和图片等基本信息。 2. 如果有需要进行耗时操作的需求,可以在onShareAppMessage调用一个异步函数,并返回一个空对象{}作为分享参数。 3. 在异步函数进行耗时操作,例如发送网络请求或执行大量计算等。可以使用Promise来管理异步操作。 4. 在异步函数完成耗时操作后,再调用wx.showShareMenu()重新显示分享按钮,并使用wx.updateShareMenu()更新分享信息。 以下是一个示例代码: ```javascript // 在onShareAppMessage处理轻量级操作 onShareAppMessage: function () { // 设置基本的分享信息 const shareInfo = { title: '分享标题', path: '分享路径', imageUrl: '分享图片路径' }; // 调用异步函数进行耗时操作 this.doAsyncTask().then(() => { // 耗时操作完成后重新显示分享按钮并更新分享信息 wx.showShareMenu(); wx.updateShareMenu({ withShareTicket: true, ...shareInfo }); }); // 返回空对象作为分享参数 return {}; }, // 异步函数进行耗时操作 doAsyncTask: function () { return new Promise((resolve, reject) => { // 执行耗时操作,例如发送网络请求或执行大量计算等 // ... // 耗时操作完成后调用resolve() resolve(); }); } ``` 通过这种方式,我们可以在onShareAppMessage处理耗时操作,避免影响分享操作的性能和流畅度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值