Update div in real time with php /javascript without updating page

Asked

Viewed 1,006 times

0

My question is the following, assuming I have a div and in this div I have a php code that says that when someone enters the page sends a Curl. What I want to know basically is if there is any way that div is constantly updating for as soon as I change something display or x in x milliseconds send Curl.

Thank you

  • jquery+ ajax does not help you?

  • If I knew how to apply

  • Have you ever done anything ready in code? It’s easier to explain from something already done.

  • Search here on the tag, you will find a lot of examples and solutions for the most basic problems: http://answall.com/questions/tagged/ajax?sort=frequent&pageSize=50

1 answer

-2

PHP is Server Side and Javascript is Client Side. No way to run php 'on the fly script'.

You need to run an Ajax when you want that CURL to run.

See if that helps you:

$("button").click(function(){
    $.ajax({
         url: "demo_test.txt", 
         success: function(result){
              $("#div1").html(result);
         }
         });
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.