Browser Forward and Back buttons do not work after history.pushState

Is there an alternative to history.pushState that allows going forward and backward in the browser?

<script>
    function update_url(url) {
        history.pushState(null, null, url);
    }

    update_url('http://localhost/test41.php');
</script>