0

I want to reload div tag without refreshing the whole page.I know this question is asked by someone already but I want to get clear idea.

<p>click HERE</p>
<div class="sample">
  <?php
      function randomPassword() {
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
    $n = rand(0, $alphaLength);
    $pass[] = $alphabet[$n];
      }
    return implode($pass); //turn the array into a string
    }


$pwd=randomPassword();
  ?>
</div>

jquery code

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(p).click(function() {
$(div).reload();
});
</script>

1 Answers1

0

This method is the simplest way to fetch data from the server.This means that most uses of the method can be quite simple:

 $( "#result" ).load( "ajax/test.html" );

 $( "#a" ).load( "article.html" );

You can use this load method

Like

  $("selector").click(function () {
  $("#div").load('YourUrl');
   });
Prabhash Rawat
  • 441
  • 1
  • 4
  • 15