• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How do I refresh a DIV content?

javascriptphpjqueryhtml


PHP Snippet 1:

function updateDiv()
{ 
    $( "#here" ).load(window.location.href + " #here" );
}

PHP Snippet 2:

$("#yourDiv").load(" #yourDiv > *");

PHP Snippet 3:

<script> 
$(document).ready(function(){
setInterval(function(){
      $("#here").load(window.location.href + " #here" );
}, 3000);
});
</script>

<div id="here">dynamic content ?</div>

PHP Snippet 4:

$('#yourDiv').load('#yourDiv > *')

PHP Snippet 5:

$.get("/YourUrl", {},
      function (returnedHtml) {
      $("#here").html(returnedHtml);
});

Related Snippets

CodeIgniter 3 is generating a session file on each request, why?

PHP | "The requested PHP extension bcmath is missing from your system."

How to convert the int value to inch in PHP [closed]

Edit XML in HTML form and submit to self

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Symfony Mercure "Failed to send an update"

Stop caching for PHP 5.5.3 in MAMP

Laravel Route issues with Route order in web.php

Sum array values of a column within each column of an array with 3 levels

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

Populate Dynamic Dropdowns List in Codeigniter

Appending data to an anchor tag

Yii2 select2 database exception number of bound variables does not match number of tokens

What is the difference between client-side and server-side programming?

About Contact Privacy policy Terms and conditions