交叉浏览器-自定义是/否弹出页面[已解决] [英] Cross Browser - Custom Yes/No popup page [SOLVED]

查看:82
本文介绍了交叉浏览器-自定义是/否弹出页面[已解决]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要一个简单的自定义是/否"弹出对话框,该对话框可以暂停父页面上的执行,直到从该弹出窗口返回响应为止.

在这种情况下,由于我的浏览器是Safari(我只能使用Safari),因此showModalDialog()对我没有帮助.

链接上给出的解决方案: http://projectshadowlight.org/jquery-easy-confirm-dialog [ ^ ]帮不上忙,因为基于某些用户定义函数中的if-else,而不是直接在控件的任何事件上出现.

对此,我将不胜感激!

谢谢

Hi,

I need a simple custom Yes/No pop up dialog which can halt the execution on parent page till the response is back from this popup.

showModalDialog() does not help me in this case as my browser is Safari (I can use safari only).

solution given on link: http://projectshadowlight.org/jquery-easy-confirm-dialog[^] could not help me as in my case pop up opened based on some if-else in a user defined function, not directly on any event of a control.

I would appreciate any quick help on this!

Thanks

推荐答案

您可以尝试 jQuery modal-dialog或UI-confirm-dialog 并将其配置为yes-no选项. > 参考:
如何创建jQuery确认对话框替换 [ ASP.NET jQuery UI确认对话框 [ ^ ]
ASP.NET JQuery确认对话框 [ ASP.NET确认框,其中包含使用modalpopup的是/否按钮选项 [ ^ ]
You can try jQuery modal-dialog or UI-confirm-dialog and configure it for yes-no option.
Refer:
How to Create a jQuery Confirm Dialog Replacement[^]
ASP.NET jQuery UI confirm dialog [^]
ASP.NET JQuery Confirm Dialog[^]

OR

you can use Ajax ModalPopupExtender for it if it''s an ASP.NET web application.
Refer: ASP.NET confirmation box with yes/no button options using modalpopup[^]


感谢Sandeep,您向我展示了一种找到解决此问题的方法的方法.

伙计们,我为模态对话框问题创建了一种解决方法.但是,它不是ShowModalDialog()的确切替代方法,但可以用作一个很好的解决方法.

步骤:1
将JQuery UI文件添加到您的包含目录中

步骤:2
添加以下代码以将JQuery UI文件包括到要从其打开模式对话框的父页面中.

Thanks Sandeep, you have shown me a way to find the workaround for my issue.

Folks, I have created a workaround for my modal dialog issue. However, it is not the exact alternative to ShowModalDialog() but can be used as a good workaround.

Step:1
Add the JQuery UI files into your include directory

Step:2
Add following code to include JQuery UI files into your parent page from where you want to open the modal dialog.

<link rel="stylesheet" href="jquery-ui-1.8.21/themes/base/jquery.ui.all.css">
<script src="jquery-ui-1.8.21/jquery-1.7.2.js"></script>
<script src="jquery-ui-1.8.21/ui/jquery.ui.core.js"></script>
<script src="jquery-ui-1.8.21/ui/jquery.ui.widget.js"></script>
<script src="jquery-ui-1.8.21/ui/jquery.ui.button.js"></script>
<script src="jquery-ui-1.8.21/ui/jquery.ui.position.js"></script>
<script src="jquery-ui-1.8.21/ui/jquery.ui.dialog.js"></script>
<script language="JavaScript" type="text/javascript" src="_include/YesNo.js"></script>



//父页面或您要打开弹出窗口的任何功能上的单击事件
//页面,添加以下代码.



//on click event on parent page or any function from where you want to open popup
//page, add following code.

GetPopUp();



步骤:3
通过将以下代码粘贴到文本文件中,创建文件YesNo.js.



Step:3
Create file YesNo.js by pasting the below code in a text file.


(function(){ var divTag = document.createElement(" ); divTag.id = " ; divTag.title = " ; document.body.appendChild(divTag); var p = document.createElement(" ); p.id = " ; p.innerHTML =<您的自定义消息> ;; document.getElementById(" ).appendChild(p); var 选项;
(function() { var divTag = document.createElement("div"); divTag.id = "dialog-form"; divTag.title="Test Pop-Up"; document.body.appendChild(divTag); var p = document.createElement("p"); p.id="msg"; p.innerHTML=<Your custom message>; document.getElementById("dialog-form").appendChild(p); var option;


这篇关于交叉浏览器-自定义是/否弹出页面[已解决]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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