• 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

Store multiple fields in JSON column (Nova CMS)

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

Toggle between a textbox and a select using PHP

Upload a file Using PHP and JavaScript

Open a popup box after receiving result from ajax

Can we define variables in `.tpl` files?

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

Laravel Model save() & update() Not Saving

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

Post Form Data To phpmyadmin Database

disable two buttons after clicking another button

PHP file_get_contents function

Undefined variable in Laravel 8 project (php 7.4)

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

About Contact Privacy policy Terms and conditions