如何在按钮点击时显示弹出窗口? [英] How to show popup on button click?

查看:126
本文介绍了如何在按钮点击时显示弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在计算兴趣所以需要时间超过10分钟到1小时,所以我想显示弹出的图像旋转文本细节直到计算完成。

计算后是完全自动关闭弹出窗口。



此外,在弹出窗口加载时我想要更新数据库中的弹出文本,如果可以显示剩余和计算的详细信息。



我尝试过的事情:



我无法完成。请帮我提供示例代码或示例。

I am calculating interest so it takes time more than 10 minutes to 1 hour, so i want to show the pop up with image rotating with text details till the calculation is complete.
After the calculation is complete auto close the popup.

Also during the popup is loading i want to update the popup text from database too if posible with showing remaining and calculated detai.

What I have tried:

I could not complete. Please help me with sample code or example.

推荐答案

好的,所以您的要求是:

计算正在进行时显示弹出窗口剩下的计算细节。

好​​吧,这段代码只是在ajax进度开始之前显示弹出消息。并在成功时显示计算的详细信息。完成ajax调用后,隐藏弹出窗口。 />
showPopup(正在进行计算!);

Okay,so your requirement is:
Display popup while calculation is going on with the remaining calculation detail.
Well, this code is just showing the popup with a message before ajax progress starts.And show the calculated details at success.And on completion of ajax call,hides the popup.
showPopup("Calculation is under process!");


.ajax({
键入:POST,
url:你正在计算的网络服务的网址,
data://数据在这里
contentType:application / json; charset = utf- 8,
dataType:json,
成功:函数(响应){
if(response.d.Code == globalItem.WebServiceStatus.Success){
showPopup( response.d.ResponseItem [0]);
}
},
错误:函数(jqXHR,异常){
//你的异常n消息代码在这里
},
完成:function(){
hidePopup();
}
});
.ajax({ type: "POST", url: "url of the web service where you are calculating", data: //data goes here contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { if (response.d.Code == globalItem.WebServiceStatus.Success) { showPopup(response.d.ResponseItem[0]); } }, error: function (jqXHR, exception) { //your exception message code here }, complete: function () { hidePopup(); } });


这篇关于如何在按钮点击时显示弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆