• 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

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

advanced custom fields wordpress custom class

Server-sent events in PHP (without echo or print)

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

Can I use a WooCommerce function without any WooCommerce page?

Ajax GET request fails in laravel 8

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

Explode not working properly with dash

Saving Data from form to database using AngularJS and php

Target Laravelista is not instantiable

Form repeater send wrong data with last element in Laravel

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

Set quantity minimum, maximum and step at product level in Woocommerce

MySQL upgrade causing unexpected results on simple WHERE clauses

OctoberCMS / Anonymous Global Scope

About Contact Privacy policy Terms and conditions