我正在使用 CakePHP 1.3 和http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
. 我遇到的问题是,在 AJAX 调用重新加载页面<div id="part2">
时,它会重新加载. 如何隔离更新并仅加载一部分?test_page.ctp
<div id="part2">
<div id="part2">
<div id="part2">
test_page.ctp
CakePHP 代码在test_page.ctp
:
// at the beginning of cpt file
$this->Paginator->options(array(
'evalScripts' => true,
'update' => '#part2',
'before' => $this->Js->get('#loading')->effect('fadeIn', array('speed' => 'fast')),
'complete' => $this->Js->get('#loading')->effect('fadeOut', array('speed' => 'fast'))
));
// at the very end of ctp file
echo $this->Js->writeBuffer();
.../controller_name/test_page
初始加载时我的页面 ( ) 的布局:
- - - - - - - - - - - - - - - -
| <div id="part1">...</div> |
- - - - - - - - - - - - - - - -
| <div id="part2"> |
| ... |
| <previous> 1 2.. 5 <next> |
| </div> |
- - - - - - - - - - - - - - - -
.../controller_name/test_page
移动到另一个页面后,我的页面 ( ) 的布局:
- - - - - - - - - - - - - - - -
| <div id="part1">...</div> |
| this <div> is not reloaded |
- - - - - - - - - - - - - - - -
| <div id="part2"> |
| <div id="part1"> |
| entire next page |
| </div> |
| </div> |
- - - - - - - - - - - - - - - -
我有一个问题,当我只想更新其内容时,AJAX 调用将整个test_page.ctp
插入。<div id="part2">
<div id="part2">