其实我在做zendframework-2.0.3。根据 zendframework-ZendSkeletonApplication-zf-release-2.0.3-0-g657a752 我添加了所有脚本但 .ready()
没有工作。在我的视图页面中,我只添加了这段代码
<script>
$(document).ready(function(){
alert('ok');
});
</script>
但它不工作,但 .click() 和其他功能工作。这是我在布局中添加脚本的方式 headTitle('ZF2 '. $this->translate('Skeleton Application'))->setSeparator(' - ')->setAutoEscape(false) ?>
<?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') ?>
<!-- Le styles -->
<?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/images/favicon.ico'))
->prependStylesheet($this->basePath() . '/css/foundation.min.css')
->prependStylesheet($this->basePath() . '/css/foundation.css')
->prependStylesheet($this->basePath() . '/css/app.css')
?>
<!-- Scripts -->
<?php echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',))
->prependFile($this->basePath() . '/js/bootstrap.min.js')
->prependFile($this->basePath() . '/js/app.js', 'text/javascript')
->prependFile($this->basePath() . '/js/jquery.foundation.orbit.js', 'text/javascript')
->prependFile($this->basePath() . '/js/jquery.js', 'text/javascript')
->prependFile($this->basePath() . '/js/validation.js', 'text/javascript')
->prependFile($this->basePath() . '/js/jquery.foundation.alerts.js', 'text/javascript')
->prependFile($this->basePath() . '/js/jquery.foundation.forms.js', 'text/javascript')
->prependFile($this->basePath() . '/js/jquery.foundation.buttons.js', 'text/javascript')
->prependFile($this->basePath() . '/js/date.js', 'text/javascript')
?>
</head>
请帮我