我在 Zend 框架中工作。我有这样的布局:
<html>
<head>
<script>
function myBeforeSendCallbackJsFunc() {$('#content-loading').show();}
function myCompleteCallbackJsFunc() {$('#content-loading').hide();}
</script>
</head>
<body>
<div id="menu">
<?php
echo $this->ajaxLink("<li>MENU 1</li>", '/controllertest/actionindex', array('update' => '#content', 'beforeSend' => 'myBeforeSendCallbackJsFunc();', 'complete' => 'myCompleteCallbackJsFunc()'), array('format' => 'ajax'));
?>
</div>
<div id="content">
</div>
<?php echo $this->jQuery()->enable()->uiEnable(); ?>
</body>
</html>
在这种情况下,ajaxLink 函数可以完美运行。我触发了 MENU 1,'#content' 得到了 '/controllertest/actionindex' 内容。但是,如果在“/controllertest/actionindex”中存在 ajaxLink 函数,它只有在我再次包含时才有效:
<?php echo $this->jQuery()->enable()->uiEnable(); ?>
为什么?