• 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

Split a string array into pieces

Is there a way to correctly use sanitize_text_field and wp_unslash that doesn't cause psalm to error with "expects string, possibly different type"

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Cut an arabic string

javascript html popup window

Hi, I am making a contact form thingy, and my php isn't working any reason why?

Use same method for inertia response and json response Laravel Jetstream

How to pass data to all views in Laravel 5?

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

Create a zip file and download it

Center point of multiple gps coordinates with php

Change the alert text on add to cart action without selected variation in Woocommerce

How to show a popup modal in codeIgniter?

PHP array stringify

Laravel Pagination links() not working

About Contact Privacy policy Terms and conditions