• 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

Confirm Leave on External Links in Wordpress

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

How to get unique slug to same post-title for other time too?

Parameter is not sent to Laravel route in Ajax

How can I get new CSRF token in LARAVEL by using ajax

Implode columnar values between two arrays into a flat array of concatenated strings

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

How can I get user id from session in javascript?

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

Sort multidimensional array by column value within a column

Xdebug 3 not showing in phpinfo on m1 Monterey

Refresh specific HTML content that retrieves data from MySQL

Display Link Title Instead of URL in XSL

(Cache::lock()) -> get() -- Under what conditions does it return false?

Populate Dynamic Dropdowns List in Codeigniter

About Contact Privacy policy Terms and conditions