Via more investigation, I think I've come across the issue.  The
question is whether this is a bug / needed feature.

It appears that when you use $.history, the click happens twice --
once when you click on whatever you want to click that triggers some
jquery and secondly when the history plugin does it's $.click.

This means, that if you were to add a simple

$('div#my_div').history(function() {
  $('div#hide').hide();
  $('div#show').show();
});

That the .hide() and .show() will get executed twice.  This in itself
isn't particularly harmful as far as display goes --
calling .hide() / .show() on elements that are already hidden/shown
won't unhide / unshow them.  The question I have is, should adding a
toggle to the history be done via $.remote or $.history?  If it's
$.history, then I see a potential problem... if I had the following:

$('div#my_div').history(function() {
  $('div#toggle').toggle(function() {
    $('div#hide_show').hide();
  }, function() {
    $('div#hide_show').show();
  });
});

It would seem that what would happen is that the toggle would appear
to not work.  I haven't tested this yet, but based on the behavior I
am seeing this is the behavior I would expect to see in the test.

Part of this is brought about by the fact that I am, admittedly,
trying to do something that I don't think any of the history plugins
intended -- I want to log a function that will either do an ajax call
or a simple DOM manipulation depending on some condition.  I myself am
split on whether or not this is something the plugin should handle,
though I do feel that the $.history method should prevent the second
"click" like the $.remote function does for firefox.

On Oct 10, 9:01 am, Leanan <[EMAIL PROTECTED]> wrote:
> Well, originally I had thought that the duplication went away.
>
> It appears now that the duplication only happens when I load datasets
> that are longer than (some yet to be determined) length / time.  I was
> browsing through the code of the plugin and I noticed there was some
> timer stuff added for Opera (I think, haven't looked again and am
> operating on memory).  Perhaps I need to add something similar to
> Firefox and / or IE?  Ideas?
>

Reply via email to