同时ajax请求

同时ajax请求,ajax,cakephp,Ajax,Cakephp,我正在尝试每5秒以下面的代码运行远程功能。如果我删除频率选项,它只运行一次。我尝试了remoteTimer函数,但当我使用remoteTimer函数时,脚本的一些代码超出了脚本标记,我在网页中看到了这一点 echo $ajax->form(array('type' => 'post', 'options' => array('model' => 'Thing', 'url' => array('controller' => 'things',

我正在尝试每5秒以下面的代码运行远程功能。如果我删除频率选项,它只运行一次。我尝试了
remoteTimer
函数,但当我使用
remoteTimer
函数时,脚本的一些代码超出了脚本标记,我在网页中看到了这一点

echo $ajax->form(array('type' => 'post', 'options' => array('model' => 'Thing',
        'url' => array('controller' => 'things', 'action' => 'xyz'),'update' => 'dy4', 'indicator' => 'ldng', 'loading' => ( $ajax->
        remoteFunction(array('url' => array('controller' => 'stories', 'action' =>
        'keep'), 'update' => 'dy3', 'frequency' => 5))))));echo $form->input('a', array('type' => 'checkbox'));echo $form->input('b', array('type' => 'checkbox')); echo $form->end('RUN');

如果在这种情况下,不能使用CakePHP助手来完成,我如何使用JavaScript来完成

在一个非常简单的控制器中使用remoteTimer。查看页面源代码和
标记之间的代码,您将得到满足您需要的代码。您可以使用该代码作为“加载”选项的值。

谢谢ghaxx,我尝试过,但它不起作用,belwo是我的代码,您能帮我找出它不起作用的原因吗,echo$ajax->form(array('type'=>'post',options'=>array('model'=>'Thing'、'url'=>array('controller'=>'things'、'action'=>'xyz')、'id'=>'choostateform'、'name'=>'choostateform'、'update'=>'dy4'、'indicator'=>'ldng'、'loading'=>'show()));下面是远程定时器的代码,function show(){/}嗯……我指的是实际javascript的
标记之间的代码。:)所以从字面上看,它介于
//和
//]>
之间。我也在想,你的代码是否比这里的代码有更多的换行符。至少这里的这个不是很可读。