• 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

How to display MySQL table using php and edit it in a web browser

Facebook PHP SDK - will not logout properly

protect my blog content

Insert And Retrieve Data in MySQL with $.post Noob Question

How can I create a Download Page with post php method?

How to validate Envato Purchase Code in PHP

Convert PHP array into HTML tag attributes separated by spaces

Error converting docx to pdf using Unoconv

Converting IPv6 to IPv4 address in PHP

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Is it possible to change the table name in the migration file-laravel

Laravel Displaying image from database

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

How to render html from a @foreach loop in a textarea

How to increase the PHP upload limits [duplicate]

About Contact Privacy policy Terms and conditions