CobbTheWarriorsRPG Posted October 4, 2015 Share Posted October 4, 2015 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 IIYAMA Posted October 4, 2015 Moderators Share Posted October 4, 2015 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
CobbTheWarriorsRPG Posted October 4, 2015 Author Share Posted October 4, 2015 function storeLastPage() lastPage = getBrowserURL ( brow1 ) outputChatBox(""..lastPage.."") end addEventHandler("onClientBrowserNavigate", brow1, storeLastPage) It works but when it wants 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now