• 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

Required field only if another field has a value, must be empty otherwise

Symfony - "framework.test" config is not set to true

Creating live search with AJAX and CodeIgniter

Add 2 Webcam in one page with WebcamJS

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How can I get user id from session in javascript?

Send same name multiple checkbox values via ajax

PHP: How to solve ob_start() in combination imagepng() issue?

301 Redirect to remove query string on homepage only

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

Coinpayments create_transaction "ERROR: Invalid command!"

Explode not working properly with dash

OAuth2 Token PHP

About Contact Privacy policy Terms and conditions