Klaus,

I've created a demo that exhibits this behavior.  I modified your demo
that is included with the script at http://www.stilbuero.de/jquery/history/

All you should have to do is change your index.html to be the
following:

<html lang="en">
  <head>
      <meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <meta http-equiv="Content-Script-Type" content="text/
javascript">
      <title>jQuery history/remote - solution for hijaxing links</
title>
      <script src="jquery-1.1.3.1.pack.js" type="text/javascript"></
script>
      <script src="jquery.history_remote.js" type="text/javascript"></
script>
  </head>
  <body>

    <div id="div1">
      <a href="#test1" class="testing" id="Chap1">Test Chap1</a><br>
      <a href="#test2" class="testing" id="Chap2">Test Chap2</a><br>
      <a href="#test3" class="testing" id="Chap3">Test Chap3</a><br>
    </div>

    <div id="div2"> </div>
    <script type="text/javascript">
      $(document).ready(function() {
        $.ajaxHistory.initialize(function() {
          $('#div1').show();
          $('#div2').hide();
        });

        $('.testing').click(function() {
          if ($(this).attr('id') == "Chap1") {
            $.get('chapter-1.html', function(data) {
              $('#div2').append(data);
              $('#div1').hide();
              $('#div2').show();
            });
          }
          if ($(this).attr('id') == "Chap2") {
            $.get('chapter-2.html', function(data) {
              $('#div2').append(data);
              $('#div1').hide();
              $('#div2').show();
            });
          }
          if ($(this).attr('id') == "Chap1") {
            $.get('chapter-1.html', function(data) {
              $('#div2').append(data);
              $('#div1').hide();
              $('#div2').show();
            });
          }
        });
      });
    </script>
  </body>
</html>

You should notice that every time you click on the Test links, you
will actually get the html page twice instead of once.

Reply via email to