• 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

Laravel Livewire: jQuery not working in child component loaded via @if statement

auth pages not getting css in laravel

How to add class name to an existing tag in php

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

No result using makeStyles Material UI in react 18

Put content of wordpress page inside div

Send same name multiple checkbox values via ajax

Extract string between first whitespace and last whitespace in php

Parameter is not sent to Laravel route in Ajax

Pass an image through AJAX [duplicate]

Set quantity minimum, maximum and step at product level in Woocommerce

What is the difference between client-side and server-side programming?

Facebook API, get page post link (PHP)

Laravel no logout option from menu after successfull login

Calculating Median of an array in PHP

About Contact Privacy policy Terms and conditions