• 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

Converting array to string and then back in PHP

Laravel implode array items to new lines

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Minimum order amount except for specific shipping method in WooCommerce

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Unable to run composer install

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Warning: sqlite_query() expects parameter 1 to be resource, string given

selected value from the listbox in php

Spam Filter in Contact Form

how can I set a session variable in Drupal 8 and get it in a php script?

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

generate an Excel file using PHP

protect my blog content

About Contact Privacy policy Terms and conditions