RE: Synchronous call with AJAX?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zaid, I would suggest using Prototype ( http://prototype.conio.net/ ) for
this. It's basically a collection of OO JavaScript routines, but written
really well.


This AJAX client side implementation can be written in 3 lines of code :-

<script src="prototype.js"></script>

<script>
new Ajax.Updater('eventsblock', 'index.php', { method: 'post', parameters: {
task: 'ajaxshowmonth', newdate: newdate } , evalScripts: true} );
</script>

<div id="eventsblock"></div>


The PHP backend code is then written to handle the incoming parameters, in
this case 'task=ajaxshowmonth', and output the HTML accordingly.

Rob.

-----Original Message-----
From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of Shaikh Md. Zaid
Sent: 13 March 2007 10:05
To: php-objects@xxxxxxxxxxxxxxx
Subject:  Synchronous call with AJAX?

Hi Folks,

I have stuck with a situation where I need to make synchronous calls through
AJAX. Sounds great, isn't it? anyways. I need something like

for ($x=1; $x<=10; $x++) {
    call to a AJAX function which would call a php file on server
    iterate to next when a response is received if there is some error,
connection    error or something like that i need to get that error and then
go for next iteration.
}

That is needed because our current framework works on AJAX and we cannot
change the framework so I need to device a way so that we can make
synchronous calls to PHP on server.

When PHP will return a response to callback function it will show a popup
screen. popup screen will have a PRINT button that print button will then
call a php and that will print a document. after printing of that document
the next call to that AJAX will be made.

Regards,
Zaid.

***********************************************************************************
Any opinions expressed in email are those of the individual and not necessarily those of the company. This email and any files transmitted with it are confidential and solely for the use of the intended recipient 
or entity to who they are addressed. It may contain material protected by attorney-client privilege. If you are not the intended recipient, or a person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited.

Random House Group + 44 (0) 20 7840 8400
http://www.randomhouse.co.uk
http://www.booksattransworld.co.uk 
http://www.kidsatrandomhouse.co.uk
Generic email address - enquiries@xxxxxxxxxxxxxxxxx

Name & Registered Office:
THE RANDOM HOUSE GROUP LIMITED
20 VAUXHALL BRIDGE ROAD
LONDON
SW1V 2SA
Random House Group Ltd is registered in the United Kingdom with company No. 00954009, VAT number 102838980
***********************************************************************************


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux