• 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

PHP mail function is sending blank message body

How to get unique slug to same post-title for other time too?

Need to display only array value in JSON output

javascript html popup window

Unable to get password for the instance created from AMI

How to create custom authentication in laravel 8?

Get WooCommerce product variation attribute terms in admin products general box

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How can i update or reset my password without entering email field in laravel-8?

Filter WooCommerce related products by Polylang language

How to get the ID of the link in another page in php

Cannot connect to own websocket server when on secured domain

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

PHP array sort and remove duplicates by two field values

printing all running session variable in laravel 5.1

About Contact Privacy policy Terms and conditions