I got this script to dynamically load html in a div..however there's a problem when you load jquery functions and i found out .live is the way to fix it but when i try it doesn't work..what am i doing wrong?
$(function() {
var newHash      = "",
    $mainContent = $("#main-content"),
    $pageWrap    = $("#page-wrap"),
    baseHeight   = 0,
    $el;
$("nav").delegate("a", "click", function() {
    window.location.hash = $(this).attr("href");
    return false;
});
$(window).live('hashchange', function(){
    newHash = window.location.hash.substring(1);
    if (newHash) {
        $mainContent
            .find("#guts")
            .fadeOut(200, function() {
                $mainContent.hide().load(newHash + " #guts", function() {
                    $mainContent.fadeIn(200, function() {
                        $pageWrap.animate({
                            heig开发者_如何学Pythonht: baseHeight + $mainContent.height() + "px"
                        });
                    });
                    $("nav a").removeClass("current");
                    $("nav a[href="+newHash+"]").addClass("current");
                });
            });
    };
});
$(window).trigger('hashchange');
});
   };
remove semicolon at the end of your event handler
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论