• 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

Appending data to an anchor tag

Update Total in checkout of Woocommerce with Ajax Request

Upload a file Using PHP and JavaScript

Get number of working days between two dates in PHP [duplicate]

PHP: How to quickly split a key=value file into associative array

Laravel 5.5 change unauthenticated login redirect url

Shopify password update using Shopify API

Using spatie/media-library, how to rename a collection of uploaded files?

Move a child array to parent array and change parent/child name

Converting IPv6 to IPv4 address in PHP

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

Can't exclude directories from .htaccess mobile redirect?

No result using makeStyles Material UI in react 18

How to loop a tree array with unknown depth and get array blocks?

wordpress : How to specify the cause "This site can’t be reached"

About Contact Privacy policy Terms and conditions