Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Updating multiple history items in one fell swoop

Expand Messages
  • Julien Lecomte
    Hi, Sorry for not getting back to you sooner. These two features will be available in the upcoming version of YUI, available in just a few weeks. So, stay
    Message 1 of 4 , Jul 5, 2007
    • 0 Attachment
      Hi,

      Sorry for not getting back to you sooner. These two features will be
      available in the upcoming version of YUI, available in just a few weeks.
      So, stay tuned!

      Regards,
      Julien


      On Tue, 2007-07-03 at 19:05 +0000, pl0dal0ng wrote:
      > Hi all, I'm getting into the History Manager to completely "Ajaxify"
      > part of a site. I'm having a problem setting it up the way I want and
      > hope you can help. I want to update two things based on one click,
      > one based on an attribute of the clicked element, and the other based
      > on the innerHTML. I set up my click event to fire two navigate events:
      > function() {
      > YAHOO.util.History.navigate('img',
      > this.attributes['myattr'].nodeValue);
      > YAHOO.util.History.navigate('imgName', this.innerHTML);
      > }
      > This behaves unexpectedly. It puts two entries into history, for one
      > thing, but the function registered to "img" doesn't fire. It does,
      > however, if I hit the back button once. The URL appears to update as
      > such:
      > default states are "img5.jpg" and "five"
      > click:
      > url1: #img=img1.jpg&imgName=five
      > url2: #img=img5.jpg&imgName=one
      >
      > Again, I don't "see" the state stored in url1, because clicking puts
      > both in the history and only the second is executed. However,
      > clicking back causes the "correct" state for the fragment in url1 to
      > be applied.
      >
      > I have ideas and questions as to their feasibility:
      > 1) how can I update multiple history items at once?
      > 2) how do I pass the clicked object to my updateStuff function as
      > this? The cheat-sheet suggests:
      >
      > YAHOO.util.History.register(str module, str initial state, fn
      > callback[, obj associated object, b scope])
      >
      > and I have tried:
      >
      > YAHOO.util.History.register("img", initialImgState, function(state) {
      > updateStuff(state) } );
      >
      > and
      >
      > YAHOO.util.History.register("img", initialImgState, function(state) {
      > updateStuff(state)}, true );
      >
      > but all firebug gives me back is [object Window]
      >
      > Help is appreciated, thanks for reading!
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.