English 中文(简体)
Jquery 弹出错误消息吗?
原标题:Jquery Pop-Up for Error Messages?
  • 时间:2012-05-22 06:18:22
  •  标签:
  • jquery

May be stupid Q for you but, I am trying to improve my jquery knowledge. I am showing error messages in alert box. Is there any standard API available to make programmers life simple. I did search but did not find it..

我知道,我们可以通过使用 css 和 html来做到这一点。但是,我在找 jquery API。所以,我们不用在 cs 中写入代码, 我们可以简单地使用 API 。

If you have any suggestions, I am very happy to try as per your suggestions. would be grateful for help...

最佳回答

你也许可以看看jqueryui。那些项目为您提供了模式对话框,这些对话框应该做你想做的事。

http://jqueryui.com/demos/dialog/

来自jqueryui网站:

A call to $(foo).dialog() will initialize a dialog instance and will auto-open the dialog by default. If you want to reuse a dialog, the easiest way is to disable the "auto-open" option with: $(foo).dialog({ autoOpen: false }) and open it with $(foo).dialog( open ). To close it, use $(foo).dialog( close )

问题回答

工作演示点击这里

@jos/demos/dialog/"rel="nol follow" >http://jqueryui.com/demos/dialog/

对话框 < 强度 > 代码

function showDialog() {
    $("#dialog-modal").dialog({
        resizable: true,
        height: 140,
        modal: true,
        position:  center ,
        buttons: {
             Yes : function () {
                $(this).dialog("close");
                return true;
            },
             No : function () {
                $(this).dialog("close");
                return false;
            }
        }
    });
};

$( input ).click(function(){
    showDialog();
});
​

Jquery-confirm library is a good choice. Look at https://craftpip.github.io/jquery-confirm/ May be used not only for confirm but also as popup, alert and so on.





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签