-2

Hello I have a PHP file named test.php. For this I have the following code:

  <body>
            function writeData(){
              
              firebase.database().ref("User").set({
              name: document.getElementById("nameField").value,
              age: document.getElementById("ageField")
              });

              ***Here the test.php file should be reloaded***
              }
              
            </script>
                <div class="box">
<center>            <div class="button">
                    
                        <button onclick = "writeData()"> Submit </button>

                    </div>
                </div>
</center>

 </body>

How can I reload my test.php file in the Javascript code? I would be happy about answers

1 Answers1

-1

with refresh


 location.reload();

if you want to load the file without refresh, you should use Ajax

workflow example with jquery


$('#yourdiv_id').load('page.php');

dılo sürücü
  • 3,821
  • 1
  • 26
  • 28