• 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

MySQL - Connection failed: No route to host

Laravel multi auth - Authentication user provider [] is not defined

protect my blog content

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

Split comma separated value from table column into rows using mysql?

How to properly start Laravel 8 with Bootstrap & authentication

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

HTML + PHP + PHPMAILER

Jquery DataTables: Data not displaying in table via Ajax

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

How do I get friend list from Friends table with counts of friends of my friends

PHP Get value from JSON [duplicate]

PHP array sort and remove duplicates by two field values

Laravel 8 factory state afterCreating

PHP: remove filename from path

About Contact Privacy policy Terms and conditions