anyone?

On 5/24/07, Mandy Singh <[EMAIL PROTECTED]> wrote:

Hello Klaus,

Thank you for a wonderful plugin.

Apart from the lack of documentation (for beginners who cant figure
everything out reading your code :), I am facing the following issues:

I am using the plugin from here:
http://www.stilbuero.de/jquery/history/

(1) Whenever I click on any link and follow everything detailed in your
code and test page, 2 ajax requests are sent per click.
This is the case even on your demo page. Why is this so? I don't want 2
requests to be sent on every click. Since it's happening for your demo page
as well which you would have surely noticed, I thought you probably already
have a solution to this.

(2) Suppose I come on page index.jsp, where I have #results div that is
filled with 1.html, now I hit 2.html and the div is filled with contents
from 2.html. Now, when I hit back, the #results div is empty (probably
because history is not updated when the page just loads). What is the
workaround for this?

I tried sending an ajax request for the default state as well when history
is initialized and that works. But, it's unnecessary since the data was
loaded when the page was served from the backend so I already have the
result of hitting 1.html. How can just push this in the history while
initializing ajaxHistory and without sending an additional ajaxRequest?

Please let me know.

Thank you,
Mandy.

       /*
        * Show the loader as soon as any ajax request on the page starts
        */
        $("#loading").ajaxStart(function(){
          $(this).show();
        });

       /*
        * Hide the loader whenever an ajax request is completed
        */
        $("#loading").ajaxStop(function(){
          $(this).hide();
        });

       /*
        * Bind the history plugin with all links that have a class=remote
        * The hash prefix is derived from the id of the elements.
        * #namesTable is the id of the div that needs to be updated with
the ajax response
        */
        $('a.remote').each(function() {
             $(this).remote('#namesTable', { hashPrefix: this.id + "-" })

        });

       /*
        * Initialize ajaxHistory
        */
        //$.ajaxHistory.initialize();

        $.ajaxHistory.initialize(function() {
          $("#namesTable").load("1.html ");
        });

Reply via email to