English 中文(简体)
利用AJAX含量中的链接进行近支线式的流行
原标题:Close jQuery modal popup using link in AJAX content

我有一个“金色”模式窗口,在这种窗口中,我装上了装着纽子的表格。 我要补充一个“距离”的链接,以明确形式,结束人口。

我正在使用新的伙伴关系法。 NET MVC4缺省模板。 我正在寻找一份文字来开展这项工作。

这是目前用于储存和展示方言的法规:

$(function () {
    // Cache for dialogs
    var dialogs = {};
    var loadAndShowDialog = function (id, link, url) {
        var separator = url.indexOf( ? ) >= 0 ?  &  :  ? ;

        // Save an empty jQuery in our cache for now.
        dialogs[id] = $();

        // Load the dialog with the content=1 QueryString in order to get a PartialView
        $.get(url + separator +  content=1 )
            .done(function (content) {
                dialogs[id] = $( <div class="modal-popup">  + content +  </div> )
                    .hide() // Hide the dialog for now so we prevent flicker
                    .appendTo(document.body)
                    .filter( div ) // Filter for the div tag only, script tags could surface
                    .dialog({ // Create the jQuery UI dialog
                        title: link.data( dialog-title ) ||  Inloggen ,
                        modal: true,
                        resizable: false,
                        draggable: false,
                        width: link.data( dialog-width ) || 370,
                        beforeClose: function () { resetForm($(this).find( form )); }
                    })
                    .find( form ) // Attach logic on forms
                        .submit(formSubmitHandler)
                        .find( a.close-dialog ).click(function (id) {
                            //dialog close logic here
                        }).end();

            });
    };

    var links = [ .loginLink ];

    $.each(links, function (i, id) {
        $(id).click(function (e) {
            var link = $(this),
                url = link.attr( href );

            if (!dialogs[id]) {
                loadAndShowDialog(id, link, url);
            } else {
                dialogs[id].dialog( open );
            }

            // Prevent the normal behavior since we use a dialog
            e.preventDefault();
        });
    });
问题回答

buttons:{Continue: function() { $(this).dialog( close );} }

在方言中提一下上述代码。





相关问题
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: &...

热门标签