English 中文(简体)
当用户点击背面或前方纽芬兰时,驾驶舱位
原标题:Running jQuery ajax function when user clicks the back or forward buttons
  • 时间:2011-11-10 13:23:11
  •  标签:
  • jquery

我有以下例子:当用户点击一条导航线时,它使用美国宇宙航空研究开发机构的某些内容加载,并使用jquery史更新了该舱位和标题:。 plugin to do some RUS5 history.

 ajaxNav: function () {

        $( #uiTabs li a, .ajax ).live( click , function (e) {

            e.preventDefault();

            $( <div id="uiLoader"></div> ).appendTo( body ).hide().fadeIn();

            var url = $(this).attr( href );

            var bodyid = $(this).data( body );

            $.ajax({
                url: url,
                timeout: 5000,
                success: function (responseHtml) {

                    isAjaxNav = true;

                    var content = $(responseHtml).find( #ajax-nav-html );

                    $( .uiContent > .uiPadding ).html(content.hide().fadeIn( slow ));

                    History.pushState(null, $(responseHtml).filter( title ).text(), url);

                    $( body ).attr( id , bodyid);
                    $( #uiLoader ).fadeOut(function () { $( #uiLoader ).remove() });

                },
                error: function (jqXHR, textStatus, errorThrown) {
                    if (textStatus ==  timeout ) {
                        uiModal.errorTimeoutModal(jqXHR, textStatus, errorThrown);
                    } else if (jqXHR.status == "500") {
                        uiModal.error500Modal(jqXHR, textStatus, errorThrown);
                    } else if (jqXHR.status == "404") {
                        uiModal.error404Modal(jqXHR, textStatus, errorThrown);
                    } else {
                        uiModal.errorUnknownModal(jqXHR, textStatus, errorThrown);
                    }

                    $( #uiLoader ).fadeOut(function () { $( #uiLoader ).remove() });

                }
            });

        });

    },

然而,当用户点击背面或 forth子时,它将改变ur和所有权(因为假肢支持这一罚款),但内容不会改变! 我将如何发现这一点,以便我能够阅读新的尿素,例如<条码>(地点)$(路名);,然后再读一些麻ja?

例如:

//IF back button or forward button clicked or relevant function e.g backspace
$(<!-- ? -->).click(function() {

// Get the current url when the back or forward button was clicked
var url = $( location ).att( pathname );

$.ajax({
                url: url,
                timeout: 5000,
                success: function (responseHtml) {

                    isAjaxNav = true;

                    var content = $(responseHtml).find( #ajax-nav-html );

                    $( .uiContent > .uiPadding ).html(content.hide().fadeIn( slow ));

                    History.pushState(null, $(responseHtml).filter( title ).text(), url);

                    $( body ).attr( id , bodyid);
                    $( #uiLoader ).fadeOut(function () { $( #uiLoader ).remove() });

                },
                error: function (jqXHR, textStatus, errorThrown) {
                    if (textStatus ==  timeout ) {
                        uiModal.errorTimeoutModal(jqXHR, textStatus, errorThrown);
                    } else if (jqXHR.status == "500") {
                        uiModal.error500Modal(jqXHR, textStatus, errorThrown);
                    } else if (jqXHR.status == "404") {
                        uiModal.error404Modal(jqXHR, textStatus, errorThrown);
                    } else {
                        uiModal.errorUnknownModal(jqXHR, textStatus, errorThrown);
                    }

                    $( #uiLoader ).fadeOut(function () { $( #uiLoader ).remove() });

                }
            });
});
最佳回答
问题回答

暂无回答




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

热门标签