Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Zend框架中未显示的jRating星星_Jquery_Zend Framework - Fatal编程技术网

Jquery Zend框架中未显示的jRating星星

Jquery Zend框架中未显示的jRating星星,jquery,zend-framework,Jquery,Zend Framework,我使用的是jRating-jQuery插件v2.2(最新版本),我可以让它在html中工作,但当我将所有内容添加到ZF项目中时,它就不起作用了。星星图像没有显示。。路径为100%,我已进行了三次检查。我对jQuery lightbox插件的图像也有问题,上一个、下一个和关闭图像按钮不能工作,ZF jQuery和图像是否缺少一些东西 以下是ZF版本: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://

我使用的是jRating-jQuery插件v2.2(最新版本),我可以让它在html中工作,但当我将所有内容添加到ZF项目中时,它就不起作用了。星星图像没有显示。。路径为100%,我已进行了三次检查。我对jQuery lightbox插件的图像也有问题,上一个、下一个和关闭图像按钮不能工作,ZF jQuery和图像是否缺少一些东西

以下是ZF版本:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >            <title>Clubs - Manchester Nightlife</title>
<link href="/MN/public/css/jRating.jquery.css" media="screen" rel="stylesheet"     type="text/css" >
<script type="text/javascript" src="/MN/public/js/jquery.js"></script>
<script type="text/javascript" src="/MN/public/js/jRating.jquery.js"></script>
    </head>
    <body>
<div class="exemple">
    <div class="basic" id="12_1"></div>
</div>
    <script type="text/javascript">
    $(document).ready(function(){
        $('.basic').jRating();
    });
</script>
</div>
    <div class="clear"></div>
    </div>
</body>

谢谢

每当我使用ZendX的JQuery库时,我总是必须将以下代码添加到布局的标题中

<?php echo $this->headLink();
      echo $this->headScript();
      $this->jQuery()->setUiVersion( '1.8.7' )->setVersion( '1.4.4' );
      echo $this->jQuery(); ?>
然后在bootstrap.php中

protected function _initViewHelpers()
{
    $view = new Zend_View();
    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();

    $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
    $view->addHelperPath('ZendX/JQuery/View/Helper/JQuery', 'ZendX_JQuery_View_Helper_JQuery');

    $viewRenderer->setView($view);
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

}

我一直认为,有足够经验开始使用ZF的人知道调试:-S“ZF jQuery和图像有什么我缺少的吗?”---是的,你缺少ZF和普通html页面的共同点:生成的html。事实上,您的浏览器并不关心源代码中的内容—30mb php框架,或者只是一个静态页面作为-is服务。。有什么帮助吗?可能吗?如果生成的html是相同的,那么它的工作原理是相同的。如果它的工作原理不一样,那么html和/或JSF中会有一些不同。在ZF中使用jQuery除了通常的东西之外,还有什么我需要知道的吗?例如:以ZF的方式添加头脚本和css?建议一些你不知道的东西总是一个坏主意。PS:毫无疑问,在这种情况下它会有所帮助,只要OP说生成的html是sameLooks,就像您可能希望确保根据错误消息在插件路径中包含jRating的路径一样。
<?php echo $this->headLink();
      echo $this->headScript();
      $this->jQuery()->setUiVersion( '1.8.7' )->setVersion( '1.4.4' );
      echo $this->jQuery(); ?>
resources.view.helperPath.ZendX_JQuery_View_Helper = APPLICATION_PATH "/../library/ZendX/JQuery/View/Helper"
protected function _initViewHelpers()
{
    $view = new Zend_View();
    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();

    $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
    $view->addHelperPath('ZendX/JQuery/View/Helper/JQuery', 'ZendX_JQuery_View_Helper_JQuery');

    $viewRenderer->setView($view);
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

}