Anyone on how I can handle this? This is really necessary for this plugin to be useful to me.
I am sure people have faced this before, can someone not help? On 5/24/07, Mandy Singh <[EMAIL PROTECTED]> wrote:
Ben, The this.id is just referring to the id of the element (anchor tag with class remote) that I am clicking on. I just wanted the hash to be customized based on the id. That works fine. Biggest worry is how to get back to default state work fine - it shows an empty box because of _defaultState or something like that being triggered from the code. Thanks, Mandy. On 5/24/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote: > > Do you have a url we can look at? I am not sure what this.id is > refering to, I think is should be $(this).attr('id'); > > On 5/24/07, Mandy Singh <[EMAIL PROTECTED]> wrote: > > > > 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 "); > > > }); > > > > > > > > > > -- > Benjamin Sterling > http://www.KenzoMedia.com <http://www.kenzomedia.com/> > http://www.KenzoHosting.com <http://www.kenzohosting.com/>