• 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

Could not decode a text frame as UTF-8.

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

Add Class in html Dynamically in PHP

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

PHP Include for HTML?

CodeIgniter force_download is not working

Batch request Google Calendar php API

Laravel get user data with profile

How to test laravel controller method?

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

PHP -> Next nearest date defined by array of days in week

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

User pool client {id}does not exist

Composer fails with kylekatarnls/update-helper on new homestead

About Contact Privacy policy Terms and conditions