开发者

bbq.pushState() with jQuery load

I am building my website with dynamically loading content. I have this code right now for pushState()

$("a.link").cli开发者_StackOverflow社区ck(function(e) { 

        var href = $(this).attr( "href" );
          $.bbq.pushState({ url: href });
          return false;
        });

         $(window).bind( "hashchange", function(e) {
            var url = e.getState( "url" );
            $("a").each(function(){
              var href = $(this).attr( "href" );
            });
          });

          $(window).trigger( "hashchange" );

What I want to do is to be able to do the same thing, but have it trigger the jQuery.load() function.

In other words, I want to be able to click a link that looks like <a href="about.php">About</a> and have the div with the id of wrapper dynamically load the a's href.

How can I do this?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜