• 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

Woocommerce product attributes with hierarchy like categories

Creating Combinations of Elements

AJAX call fails with SyntaxError: Unexpected end of JSON input

virtctl works when executed via command line but not from php exec()

Laravel 5.1 Unknown database type enum requested

Ajax GET request fails in laravel 8

How to get Laravel's CSRF Token from Another Website?

Limit WooCommerce products in cart only from one custom taxonomy

getting error while enter Command => php artisan route:list

PHP mail sending empty mails

Search for array row with specific column value and return another value from qualifying row

PHPExcel file download using AJAX call

Add 2 Webcam in one page with WebcamJS

PHPExcel_IOFactory::createWriter causes wrong behaviour

PHP: How to raise number to (tiny) fractional exponent?

About Contact Privacy policy Terms and conditions