• 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 do I set the maximum php memory limit

Insert multidimensional array to codeigniter cart

Fatal error: [] operator not supported for strings

Chunk and transpose a flat array into rows with a specific number of columns

Check if string contains a value in array [duplicate]

How to extract price from given url using Xpath?

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

PHP DOTENV unable to load env vars

Laravel eloquent update record without loading from database

Laravel Pagination links() not working

php curl_exec() Connection refused when retrieving a remote image

Execute only one time and then wait set period of time before executing again

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Get keys from associative array [duplicate]

About Contact Privacy policy Terms and conditions