Q: Ajax form submit refresh page I am using this ajax code to run actions on form submit
<script type="text/javascript">
$(document).ready(function(){
$("#ticketupdate_please_wait_box").hide();
$("#ticket_update").submit(function(e){
    $("#ticketupdate_please_wait_box").show();
    e.preventDefault();
    dataString=$("#ticket_update").serialize();
    $.ajax({
        type: "POST",
        url: "reviewtickets_history.php?seq=<?php echo $_GET["seq"]; ?>",
        cache: false,
        data: dataString,
        success: function(res){
            $("#ticketupdate_please_wait_box").hide();
            $('.overlay').fadeOut();
            if(res.indexOf("success")!=-1)
            {
                window.location.href = res.substr(8);
            }
            else
            {
                window.location.href = "/admin/helpdesk/reviewtickets.php?seq=<?php echo $_GET["seq"]; ?>#last";
            }
        }
    });
});
});
</script>

once the submit was successful i am using: window.location.href but because the page name is the same that it should be redirecting to and i am just adding the #last on the end, its just adding it and no refreshing the page
how can i make the page fully refresh and add #last on the end of the URL?

A: Can you try this,
window.location.href += "#last";
location.reload();


A: Using location.reload() https://developer.mozilla.org/en-US/docs/Web/API/Location.reload:
     if(res.indexOf("success")!=-1)
        {
            location.reload();
        }

If you want to override cache, add a true parameter: location.reload(true);
Cheers

A: if you want to reload the same page with hash value then follow below steps
window.location.href += "#last";
location.reload();

thanks
