• 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

Laravel csrf token mismatch for ajax POST Request

php - add comma thousands separator but remove trailing zeros

PHP rotate matrix counter-clockwise

possible options to create pdf file using html elements to generate invoice in php and codeigniter

how to loop through json response data using ajax jquery?

Unable to uninstall brew php from homebrew

Laravel multi auth - Authentication user provider [] is not defined

could not find driver Debian SQL Server PHP

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

Split array into 4-element chunks then implode into strings

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

send email using gmail-api and google-api-php-client

Could not decode a text frame as UTF-8.

How to get array values using foreach in laravel

How to to send mail using gmail in Laravel?

About Contact Privacy policy Terms and conditions