• 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

php - add comma thousands separator but remove trailing zeros

Modify microseconds of a PHP DateTime object

I want a way to give path to my files which are outside of public folder in laravel

Laravel post contact form giving me error 419

Insert a DIV after the 6th product only once in WooCommerce category archives

Why is this PHP array not the same?

Call authenticate manually in router middleware

Creating live search with AJAX and CodeIgniter

Make certain characters of a word from string bold

Changing font color in javascript

Star and Half Star Rating in Laravel

MISSING UPDATES FOR: MEDIA Drupal 9

Pages are working fine on localhost but not running on the hosting server

Having trouble with PDO queries (Notice: Undefined index)

cakephp save drag and drop list order to database

About Contact Privacy policy Terms and conditions