title: How to add this function 'setInterval' on this code to make my page fetch forms or data without refresh
body: <p>I have ajax and javascript, now i am fetching this modal to another page or to another separate browser. </p>
  
  <p>For now I can fetch the modal but I needed it to refresh the page before the modal will show. how can I do it without clicking refresh. I've done some research and I've seen <code>setInterval</code> function but how should i implement it through my code thanks! all I want is  to not refresh the page before the modal will show.</p>
  
  <p><strong>Onto my modal form here it is, this is the code whereas after I submit the submit button</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>if ($count != 0) {
        while($row = mysqli_fetch_array($data)) { 
            echo '&lt;div id="myModal" class="modal" style="position:fixed;  display: none; padding-top: 100px; 
            left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.9); "&gt;
                  &lt;div class="container" style="width: 100%"&gt;
                  &lt;div class="card col-12" style="background-color: red; color: white;"&gt;
                  &lt;div class="card-header"&gt;
                      &lt;p&gt;&lt;h3 class="text-center"&gt;Announcement&lt;/h3&gt;&lt;/p&gt;
                  &lt;/div&gt;
                    &lt;div class="card-body text-center"&gt;
                        &lt;h5&gt;'.$row['additional_info'].'&lt;/h5&gt;
                        &lt;p&gt;Please click refresh button to resume after the announcement&lt;/p&gt;
                    &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;img class="modal-content" id="img01"&gt;
                  &lt;/div&gt;';
                $dataid = $row['id'];
        }
    }
  </code></pre>
  
  <p>here it is the script where I want to put the <strong>setInterval</strong> function for the page to automatically not refresh</p>
  
  <pre class="lang-js prettyprint-override"><code>document.getElementById('myModal').style.display='block';
  </code></pre>
  
  <p>for now it has no any special code that is just how I show the modal but it needed to be refresh</p>
  
  <p>I expect the output of the modal should be display once i already click the submit button. and for my code the button was already click and i just want to insert the <code>setInterval</code> function for the modal to show without refreshing the page</p>