• 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

PHP random string generator

Adding one microsecond to Datetime object in PHP

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Object of class stdClass could not be converted to string error

Display a success custom notice after Placing an Order in WooCommerce

Call to undefined function openssl_decrypt

how to hide previous markers when new markers added in google map javascript api

Refresh specific HTML content that retrieves data from MySQL

How can I create a Download Page with post php method?

Add restriction to WooCommerce coupons by allowed user ID

How to create a cookie to store the timestamp of when a page is first loaded with php

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

Laravel Collections. Is there some kind of assertStructure method?

How to make a foreign key not using primary key

how to use extended ASCII instead of unicode in PHP

About Contact Privacy policy Terms and conditions