大佬教程收集整理的这篇文章主要介绍了jquery – 正在生成下载文件时友好等待消息,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我希望下面的东西能起作用,但显然它没有
var myhref = "DownloadFile.ashx?foo=bar" $.get(myhref,function (data) { window.LOCATIOn = this.href; },function (data) { alert("Could not generate file"); });
所以我想要的是在生成下载时保持ui活着
我找到了一个名为blockUI的jQuery插件(非常酷!),当你处理你的东西时,它会显示一条消息.
function proceedToSend( requesterName,requesterId ) { //Here the wait/processing message is displayed $().ajaxStart($.blockUI({ message:$('#waitmessage')})); $.ajax({ type :"POST",url : http://example.com/myurl.PHP dataType: yourDataType,data : myData,success :function ( response ) { //response processing if needed // Here the wait/processing messages is hidden $().ajaxStop($.unblockUI({ message:null })); },error :function () { alert('there was an error processing the request!!'); $().ajaxStop($.unblockUI({ message:null })); } }); }
<div id="waitmessage" class="dataContainer" style="display: none;"> <p style="font-size: 30px;">Processing request...</p> </div>
就是这样,希望它有所帮助!
以上是大佬教程为你收集整理的jquery – 正在生成下载文件时友好等待消息全部内容,希望文章能够帮你解决jquery – 正在生成下载文件时友好等待消息所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。