dev.bashar
dev.bashar

Reputation: 181

basic jquery .load with loaded page

Why the home.html links <a> is not working?

Is there any thing I must do in html pages ?

<script>
$(document).ready(function(){
    $("#content").load(getHash(), function() {
        $("a").click(function () {
            var page = $(this).attr('href').substring(1);
            $("#content").load(page);
      });
    });
});
</script>

<ul>
    <li><a href="#home.html">Home</a></li>
</ul>
<div id="content"></div>

home.html

<ul>
    <li><a href="#page.html">page</a></li>
</ul>

Upvotes: 0

Views: 46

Answers (1)

TheGeekYouNeed
TheGeekYouNeed

Reputation: 7539

remove the # from the href values.

Upvotes: 2

Related Questions