In traditional javascript you can get the text of the message of an
XMLHttpRequest by doing something like this:
xmlResponse = xmlHttp.responseXML; // xml
textResponse = xmlHttp.responseText; // text
where xmlHttp is an XMLHttpRequest Object that has received a message
from the server.
How do I access this message text in the CakePHP "complete" callback
function of an ajax link?
eg:
in my view:
=========
echo $ajax->link('link1',
array('controller'=>'tests' ,
'action'=>'simple_ajax1_fcn'),
array('complete'=>'my_js_callback()')
);
=========
in my controller:
=========
class TestsController extends AppController
{
var $name = 'Tests';
var $uses = array();
function simple_ajax1_fcn() {
$this->autoRender = false;
echo "secret message 14562642";
}
}
=========
How do I get "secret message 14562642" in my_js_callback()?
I've tried various constructs like:
request.responseText
response.responseText
Ajax.response.responseText
Ajax.responseText
XMLHttpRequest.responseText
but none seem to work.
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---