Ajax Back Button ?!?! Mootools 1.2

Discussion in 'JavaScript' started by fdoze, Apr 9, 2009.

  1. #1
    Hi,

    I'm using mootools-1.2.1-core.js and mootools-1.2-more.js
    and I'm trying to use HistoryManager to get my Back button working...

    But I cant get it working... Could you help me?


    Do you have any simple alternative to get Ajax website using Browser's Back Button?



    Thanks in advance.
     
    fdoze, Apr 9, 2009 IP
  2. fdoze

    fdoze Peon

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    fdoze, Apr 9, 2009 IP
  3. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Yea, not sure about mootools- never heard or used it. But why don't you just code it yourself?

    It would be simple enough- 1 array (or two but I'll get to that), add to the function that loads your ajax page to append the url to the array. Build a function that loads the last element in the array as a page (call your pageload function with the last element)- then link your back button to fire that function. You'll also need to remove the element that was just loaded- I would suggest to remove it then append it onto a forward array, eh? same thing with the forward button as the back button.

    Would be simple enough, how skilled are you? Otherwise I can't really help with mootools. . . Have you gone through the docs?
     
    ToddMicheau, Apr 11, 2009 IP
  4. fdoze

    fdoze Peon

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can you give me more details on that?

    Thanks.
     
    fdoze, Apr 12, 2009 IP
  5. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #5
    http://digitarald.de/project/history-manager/1-0/source/HistoryManager.js - this history manager uses mootools 1.11 not 1.2. there's a huge difference in implementation, in particular to do with classes. your best bet is to post on the mootools mail list, Harald Kirschner (digitarald) is a regular there and may be able to assist you or even offer a 1.2 version of the class.

    as was pointed out, coding such a function is easy enough in mootools or not. all you need to do is record your session urls via php and have the js reuqest latest 'good' url from a php handler. uses are, for instance, in e-commerce sites, a continue shopping button etc - they can direct you to a useful page, not history -1...
     
    dimitar christoff, Apr 13, 2009 IP
  6. fdoze

    fdoze Peon

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    fdoze, Apr 14, 2009 IP