• 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

How to unlink image from folder?

hidden INPUT value not available in $_POST

Get WooCommerce product variation attribute terms in admin products general box

PHP rotate matrix counter-clockwise

Insert And Retrieve Data in MySQL with $.post Noob Question

Prevent blank space in pdf pages (DomPdf)

Display specific shipping method if woocommerce product has specific acf field value

Laravel MSSQL Server Connection not working

Cannot connect to own websocket server when on secured domain

Adding Multiple Custom Post Types in Wordpress

How to insert data from multiple select dropdown values into database?

jQuery Ajax Post with data

Elastic Beanstalk with Laravel Envoy

Sentry on Symfony: how to exclude `NotFoundHttpException`

Component install error: JInstaller: :Install: File does not exist

About Contact Privacy policy Terms and conditions