Welcome Guest, Not a member yet? Register   Sign In
how to include javascript file in codeigniter
#4

[eluser]bretticus[/eluser]
Make sure you are using an .htaccess file similar to the one found in the wiki. It has 2 rewrite conditions that will let real files override the URL rewrite when you are hiding index.php:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Also, there is no reason to include a JS file via PHP whatsoever. All your javascript "lives" in the View partition of your application (I know there are reasons for dynamically rendered javascript every now and then, but you need a really good reason to do that in my opinion.)

Make sure that you are using the right path also. You do not need to use http://localhost/path_to.js you can get the same effect using /path_to.js. That way your views are portable.


Messages In This Thread
how to include javascript file in codeigniter - by El Forum - 08-17-2011, 01:44 PM
how to include javascript file in codeigniter - by El Forum - 08-17-2011, 01:47 PM
how to include javascript file in codeigniter - by El Forum - 08-17-2011, 02:19 PM
how to include javascript file in codeigniter - by El Forum - 08-17-2011, 04:50 PM
how to include javascript file in codeigniter - by El Forum - 08-18-2011, 04:00 AM
how to include javascript file in codeigniter - by El Forum - 08-18-2011, 04:05 AM
how to include javascript file in codeigniter - by El Forum - 08-18-2011, 09:27 AM
how to include javascript file in codeigniter - by El Forum - 08-18-2011, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB