• 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

Xdebug can't connect back to Docker host

How to identify whether webp image is static or animated?

CodeIgniter extend CI_URI undefined method

PHP/HTML: Creating A SubMenu

Sagepay Error The Vendor failed to provide a RedirectionURL

woocommerce change position of price

How to modify CSS in a specific page of the WP admin dashboard (backend)

How to add a custom field to all Woocommerce attribute terms using add_action

Laravel no logout option from menu after successfull login

Batch request Google Calendar php API

How can i hide dt if dd got empty value

Match csv filenames to table names and import

dockerizing Laravel + vue

how to redirect the user back to desired URL after login page in PHP?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

About Contact Privacy policy Terms and conditions