0
我正在Zend-Framework中工作。我有一个这样的布局:ajaxLink和jQuery的多个实例
<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函数完美工作。 我开启菜单1,'#content'获取'/ controllertest/actionindex'内容。 但如果存在 '/ controllertest /的actionIndex' 它只能内部ajaxLink功能,如果我再包括:
<?php echo $this->jQuery()->enable()->uiEnable(); ?>
为什么?
'uiEnable()'可能输出事件处理代码(不熟悉zend)。如果事件处理代码不使用事件委托(这是最好的解决方案),那么每次更换元素时都必须重新绑定事件处理程序。 WOuld有助于了解浏览器源代码的外观 – charlietfl