IE 中的 baseURL 修复 [英] baseURL fix in IE

查看:33
本文介绍了IE 中的 baseURL 修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有以下结构的网站:点击此处.我在尝试加载样式表时遇到了一些 URL 问题.更具体地说,在 admin 模块中,我使用了这个引导程序:

I'm developing a website with following structure: click here. And I'm having some problems with the URL when trying to load stylesheets. Being more specific, in the admin module I'm using this bootstrap:

<?php

class Admin_Bootstrap extends Zend_Application_Module_Bootstrap
{
    public function _initResources() {
        $view = new Zend_View();
        $view->headScript()
                ->appendFile('public/js/jquery-1.4.2.min.js')
                ->appendFile('public/js/jquery.tools.min.js')
                ->appendFile('public/js/jquery-ui-1.8.4.custom.min.js')
                ->appendFile('public/js/utils.js')
                ->appendFile('public/ckeditor/ckeditor.js')
                ->appendFile('public/ckeditor/adapters/jquery.js')
                ->appendFile('public/js/admin.js')
                ->appendFile('public/js/ie.utils.js', null, array('conditional' => 'IE'))
                ->appendFile('public/js/ie.js', null, array('conditional' => 'IE'));

        $view->headLink()
                ->appendStylesheet('public/css/blueprint/screen.css', 'screen')
                ->appendStylesheet('public/css/uploadify.css', 'screen')
                ->appendStylesheet('public/css/jquery.tools.css', 'screen')
                ->appendStylesheet('public/css/ui-theme/jquery-ui-1.8.4.custom.css', 'screen')
                ->appendStylesheet('public/css/blueprint/print.css', 'print')
                ->appendStylesheet('public/css/admin.css', 'screen')
                ->appendStylesheet('public/css/blueprint/ie.css', 'screen', 'IE')
                ->appendStylesheet('public/css/ie.css', 'screen', 'IE');
    }

}

我也在使用 <base href="<?php echo $this->baseUrl();?>/"/> 非常适合 ChromeFirefox,但在 IE 中我可以看到 ; TAG 不起作用,它使用 /ccgss/admin/ 作为 baseUrl 而不是 /ccgss/ 这会导致问题试图在 public 文件夹中加载一些东西,因为它试图在 /ccgss/admin/public 中找到.

Also I'm using <base href="<?php echo $this->baseUrl(); ?>/" /> which works perfectly for Chrome and Firefox, but in IE I could see that the <base> TAG doesn't work and it uses /ccgss/admin/ as baseUrl instead of /ccgss/ which cause problem when trying to load something in the public folder 'cause it tries to find in /ccgss/admin/public.

有没有其他方法可以将我的资源附加到引导程序中,或者我确实需要解决方法?这应该如何?

Is there any other way to append my resources in the bootstrap or I do need to workaround? How this should be?

推荐答案

尝试像这样设置路径:

 $view->headScript()
                ->appendFile($this->baseUrl() . 'public/js/jquery-1.4.2.min.js');

也尝试使用谷歌的 jquery 商店:http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

also try to use google's jquery store: http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

ps:http://code.google.com/intl/en-En/apis/libraries/devguide.html

pss:在我的应用程序中,我使用插件来加载此类库,我发现它对我来说非常有用:

pss: in my application I use plugins for loading such libraries and I found that it is very useful property for me:

resources.frontController.baseUrl = /test/

这篇关于IE 中的 baseURL 修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆