0

I have a PHP script that does not update the page with this code in JavaScript.

window.onpageshow = function(event) {
    if (event.persisted) {
        window.location.reload()    
    }
};

The same problem occurs with 534 different ways to reload a page with JavaScript.

example.php

<?php
header("Refresh:0");
?>

Any idea to let window.location.reload() call the file example.php?

2 Answers 2

1

You can use this code to simulate HTTP redirect

window.location.replace("exemple.php");

Or this to simulate a click in a Link

window.location.href = "exemple.php";
Sign up to request clarification or add additional context in comments.

Comments

0

Try this hack:

window.location.href=window.location.href

1 Comment

well its not an actual hack tbh, just a fancy way to call it that's all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.