0

I have this structure

/www
    /code_igniter
        /application
        /assets
            +img
            +css
            +js
        /controllers
        /system

I load two views in controller:

class Control extends CI_Controller {
    function __construct()
    {
        parent::__construct();
        $this->load->database();
        $this->load->helper('url');  

    }
     public function index()
    {
         $this->load->view('header');
     $this->load->view('body');
    }

}

In header view I do:

<link type="text/css" rel="stylesheet" href='<?echo base_url().'assets/'?>css/stile.css' />
<link type="text/css" rel="stylesheet" href='<?echo base_url().'assets/'?>css/chosen.css' />

<script src="<?echo base_url().'assets/'?>js/jquery.min.js" type="text/javascript"></script>
<script src="<?echo base_url().'assets/'?>js/mousewheel.js" type="text/javascript"></script>
<script src="<?echo base_url().'assets/'?>js/easing.js" type="text/javascript"></script>
<script src="<?echo base_url().'assets/'?>js/logic.js" type="text/javascript"></script>

body has pure html.

when I see source code of generated view It can find the js, css and images but for some strange reason it is not executing the js as if it would not find them...

I tested locally and it works!!

To try to reproduce error I renamed js folfer and yeah, it shows the same result as when testing on server, i then rename it to js and works locally but not in server...

Do you know what could be causing this? Is driving me crazy

Could it be a crach between jquery.min.js ? It is like is not running anything,

I also find this issue I am loading http://rhinoslider.com/ in a script in header view

 $(document).ready(function() {
           alert("a");
       $('#slider').rhinoslider({
        controlsPlayPause: false,
                showControls: 'always',
                showBullets: 'always',
                controlsMousewheel: false,                   
        slidePrevDirection: 'toRight',
        slideNextDirection: 'toLeft'
            });


           alert("b");          
        $(".rhino-prev").hide();                
        $('.rhino-next').after('<a class="form-submit" href="#" >Next</a>');
                $(".rhino-next").hide();
      alert("c");       


        });

And I am only receiving alert a message, it is not executing or loading rhino slider why could it be ?

4

1 回答 1

1

尝试这个 :

   <link type="text/css" rel="stylesheet" href='<?php echo base_url().'assets/'?>css/stile.css' />
  <link type="text/css" rel="stylesheet" href='<?php echo base_url().'assets/'?>css/chosen.css' />

  <script src="<?php echo base_url().'assets/'?>js/jquery.min.js" type="text/javascript"></script>
  <script src="<?php echo base_url().'assets/'?>js/mousewheel.js" type="text/javascript"></script>
  <script src="<?php echo base_url().'assets/'?>js/easing.js" type="text/javascript"></script>
  <script src="<?php echo base_url().'assets/'?>js/logic.js" type="text/javascript">

设置

 short_open_tag = On

php.ini文件中,以使短标签在您的本地主机上工作

希望它会有所帮助!

于 2013-03-22T04:49:05.500 回答