CSS and JS files not loading - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CSS and JS files not loading (/showthread.php?tid=20913) Pages:
1
2
|
CSS and JS files not loading - El Forum - 07-25-2009 [eluser]HooJee[/eluser] Hi Guys Whenever I load my index page none of my CSS/JS files are loaded, only the HTML text. Does anyone know why this is happening ? CSS and JS files not loading - El Forum - 07-25-2009 [eluser]davidbehler[/eluser] Could you post the source code of your index page? That might help. CSS and JS files not loading - El Forum - 07-25-2009 [eluser]HooJee[/eluser] Well, its a .htm renamed as a .php - Code below: Code: <?xml version="1.0" encoding="utf-8"?> CSS and JS files not loading - El Forum - 07-25-2009 [eluser]Tyler Diaz[/eluser] If you're using .htaccess to remove the index.php then this might fix it. Add this to your .htaccess file and reload. Options +FollowSymlinks RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] Otherwise, Use Inline CSS via <style type="text/css"> /* CSS HERE */ </style> At the head of your html document till you find the solution. CSS and JS files not loading - El Forum - 07-25-2009 [eluser]davidbehler[/eluser] Where are your css or js files located? If your folders look like this Code: www Code: <link rel="stylesheet" type="text/css" href="<?=base_url()?>css/index.css" /> CSS and JS files not loading - El Forum - 07-25-2009 [eluser]HooJee[/eluser] Man it sucks being a framework newbie. None of the above sugguestions worked. My folder dir looks like: www -system --application ---views ----css ----js CSS and JS files not loading - El Forum - 07-25-2009 [eluser]Tyler Diaz[/eluser] In that case, feel free to also try. $this->load->library('parser'); // Unless you havent loaded it already. $this->parser->parse('css/index.css'); Add that to where your CSS link is. CSS and JS files not loading - El Forum - 07-25-2009 [eluser]HooJee[/eluser] You'll have to forgive me because I am experiencing a new problem. I deleted and installed the latest version of WAMP because the PHP engine wasnt executing the code. Now that I try to create a simple welcome controller and echo some stuff out I keep getting the following error: An Error Was Encountered The URI you submitted has disallowed characters. CSS and JS files not loading - El Forum - 07-25-2009 [eluser]Tyler Diaz[/eluser] The Url links based off code igniter can only contain the following characters: a-z 0-9~%.:_- Your local development must be attatching some kind of extra string to it. If it is for local development only you can go to system > application > config > config.php Find this: Code: /* And delete the characters so It'll look like $config['permitted_uri_chars'] = ''; But please, enable the url permitted chars as soon as you can as it is a huge security flaw to go by. CSS and JS files not loading - El Forum - 07-25-2009 [eluser]HooJee[/eluser] Aha, cheers that worked. Well, Im using PHP 5.3.0 and CI was spitting out all these depreciated errors until I disabled it in the index.php file. Maybe that could have something to do with it ? I will try out the above suggestions now and see if they work. |