views:

205

answers:

1

Hi

I make an AJAX call to a PHP script like so:

function convertNow(validURL){      
     $.ajax({
       type: "GET",
       url: "main.php",
       data: 'url=' + validURL,
       success: function(msg){
       alert(msg);
       }//function
     });//ajax
}//function convertNow

From the above all it does is receive a lot of text from PHP right at then end. In actual fact, what the PHP script is doing is a lot of prints every few seconds for about a minute. I want this to be shown in real time.

I think the problem is the way I am using JQuery because I have tested this without any AJAX and the PHP script outputs each print_r to the browser in real time! I just need to replicate this but using AJAX.

Thank you for any help and guidance.

+2  A: 

Go back to the start. Write a request with what you actually want to do. You'll probably find that you need to adopt a method such as polling, or maybe use something like COMET to achieve what you want.