• 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

Can't call javascript alert alertify library from PHP

Redis Command To Sort Keys

Render the content of default_filter.php in Joomla front-end

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

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

XDebug not working in VScode for php debugging

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Symfony Error: "An exception has been thrown during the rendering of a template"

Laravel dosen't connect with Oracle

Google API Heatmap Layer exception, why?

Show rotation of tweets using current day of month

How to find phpcs current default standard

Parameter is not sent to Laravel route in Ajax

Symfony process run throws exception - executing on command line works

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

About Contact Privacy policy Terms and conditions