• 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

How can i update or reset my password without entering email field in laravel-8?

Laravel print last executed SQL query with Query log

How do I truncate a decimal in PHP?

PHP sort array of objects by two properties

How to delete old images from public folder on update using Laravel

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

how to loop through json response data using ajax jquery?

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

Change the alert text on add to cart action without selected variation in Woocommerce

Yii Ajax Submit button

How to use React Router with Laravel?

Facebook API, get page post link (PHP)

merging two arrays with specified index

how do i retrieve and display the alt text of an image in wordpress?

laravel sanctum Route [login] not defined

About Contact Privacy policy Terms and conditions