Javascript 'Back' button

Options
SeanWade
SeanWade Member Posts: 2
edited April 4 in Ask a Question

I have a dynamic page that I want to include a Javascript browser back button. Currently I have a button that when you click 'back' button it directs you to a defined page. I want to change it to a Javascript that brings you back to the last page the browser was on.

I think this script might work:

<button onClick="history_back()">Go back</button>    <script>        function history_back() {            window.history.back();        }     </script>

But it's hard to figure out where exactly to paste it in a Flex Box. Currently I've tried a couple times and it's not working. It's not saving in the HTML dev.

Best Answer

  • Aj_Cre8
    Aj_Cre8 Member Posts: 665 MVP
    Answer ✓
    Options

    You cannot access HTML/CSS or dev mode of a Flex Section. Your best bet is to add it in a normal row with a HTML widget. If you do that, ensure your button has a class that is styled within the site.css file in dev mode. Or you can just use the native Duda Classes for it to inherit it.