jQuery Alert -jAlert单击确定 [英] jQuery Alert -jAlert OK click

查看:199
本文介绍了jQuery Alert -jAlert单击确定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jAlert中单击确定"时,不会触发任何事件,即使对话框没有关闭:

On click of OK in jAlert nothing is triggered, even the dialog box doesn't close:

$(document).ready(function () {
     $("#confirm_button").click(function () {
         jAlert("Submitted", "Approval", function () {
             //My code goes in here
         }); 
     });
});

我需要单击OK才能获得活动,请在此帮助我!

I need to get the event on OK click, please help me out in this!

HTML

<html>
<head>
    <title>Demo</title>
    <script src="jquery.js" charset="utf-8" type="text/javascript"></script>
    <script src="jquery.alerts.js" charset="utf-8" type="text/javascript"></script>
    <link href="jquery.alerts.css" charset="utf-8" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#confirm_button").click(function () {
                jAlert("Submitted", "Approval", function () { 
                    //
                }); 
            });
        });
    </script>
</head>
<body>
    <form runat="server">
    <asp:Button ID="btnAlert" runat="server" Text="Click"/>
    </form>
    <input id="confirm_button" type="button" value="Show Confirm" />
</body>
</html>

推荐答案

jAlert应该像这样被调用:

$.jAlert(...)

更改它,代码将起作用. 小提琴.

Change that, and the code will work. Fiddle.

这篇关于jQuery Alert -jAlert单击确定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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