Welcome Guest, Not a member yet? Register   Sign In
CSS and Javascript is not loading.
#1

[eluser]Isuru[/eluser]
I am creating this site and when I create index controller css and javascript work as a charm. But when I create other controllers I get and not styled page. when I view the source I can see css file references.

I am new to CI.

Thanks!

Code:
function index(){
        $data['title'] = "Welcome to Best Job Board";
        $data['navlist'] = $this->cate->getCategoriesNav();
        $data['mainf'] = $this->jobs->getMainFeature();
        $skip = $data['mainf']['id'];
        $data['sidef'] = $this->jobs->getRandomJobs(2, $skip);
        $this->load->vars($data);
        $this->load->view('home');
    }





function cate($id){

        $cat = $this->cate->getCat($id);
        //if(!count($cat)){
           // redirect('welcome/index', 'refresh');
        //}
        $data['title'] = "Job Board |".$cat['id'];
        $data['listing'] = $this->cate->getJobByCategory($id);
        $data['category'] = $cat;
        $data['navlist'] = $this->cate->getCategoriesNav();
        $this->load->vars($data);
        $this->load->view('home');



    }
#2

[eluser]augustowloch[/eluser]
the CATE function is into the same controller (welcome/cate) ???
if it's in other controller, it's into another folder than the welcome controller?
when you view the source code from the non-styled-page, and you click over the css or copy-paste the address, is it well formed?
#3

[eluser]InsiteFX[/eluser]
And what doe's your home view or template file look like? Post the code!
Showing your controller doe's not help when the problem is in your view or template file!

InsiteFX
#4

[eluser]toopay[/eluser]
Either your htaccess or like InsiteFX said, the url path in your view file!




Theme © iAndrew 2016 - Forum software by © MyBB