Jump to content

[HELP]Store the last page and return it on the browser


Recommended Posts

Well, i am making a browser, i want to do the back button, store the last page in a variable and when you click the back button return to the last page, see the code it doesnt work

    function storeLastPage() 
    lastPage = getBrowserURL ( brow1 ) 
        function returnLast() 
            loadBrowserURL(brow1, lastPage) 
        end 
        addEventHandler("onClientGUIClick", backBtn, returnLast, false) 
    end 
    addEventHandler("onClientBrowserNavigate", brow1, storeLastPage) 

Link to comment
  • Moderators

Move line 3 t/m 6 out of the function storeLastPage.

Because every time you trigger onClientBrowserNavigate, it will create a new function which will send you to this lastPage.

There is just one thing I do not know. If the onClientBrowserNavigate is triggered, getBrowserURL will send back the new url or the old one. This is something you have to debug by yourself.

Link to comment
    function storeLastPage() 
        lastPage = getBrowserURL ( brow1 ) 
        outputChatBox(""..lastPage.."") 
    end 
    addEventHandler("onClientBrowserNavigate", brow1, storeLastPage) 

It works but when it wants :lol: and when i navigate it gives to me 3 times the web page in debug

https://www.google.com.co/?gfe_rd=cr&ei ... gws_rd=ssl

https://www.google.com.co/?gfe_rd=cr&ei ... gws_rd=ssl

https://www.google.com.co/?gfe_rd=cr&ei ... gws_rd=ssl

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...