Welcome Guest, Not a member yet? Register   Sign In
Add a .js file and routes
#1

I have a bug for days which drives me crazy. I spent hours to try to solve it but I could not. It's really annoying because I guess it only takes 2 minutes to solve it when you know CodeIgniter :(

In my menu.php View, I want to add :
<script src="menu.js"></script>
which is in my View folder too, but it did not work. I get a 404 Not Found error.

In Config, my App.php is well set for public string $baseURL
I tried to use $baseURL in my url too, but always the same error.

Finally I tried to put the file in the public folder and :
<?php
helper('html');
echo script_tag('public/menu.js');
?>

But always the same 404 Not Found error.

I tried autorouting, and a lot of other things, but nothing worked and now I am juste crazy because adding a simple .js file should be easy :(

Do you have any idea to help me ?

Thanks a lot
Reply


Messages In This Thread
Add a .js file and routes - by arna - 08-10-2023, 06:58 PM
RE: Add a .js file and routes - by kenjis - 08-10-2023, 07:18 PM
RE: Add a .js file and routes - by ozornick - 08-10-2023, 10:36 PM
RE: Add a .js file and routes - by InsiteFX - 08-10-2023, 10:41 PM
RE: Add a .js file and routes - by arna - 08-11-2023, 07:30 AM
RE: Add a .js file and routes - by kenjis - 08-11-2023, 06:23 PM
RE: Add a .js file and routes - by sheilaf - 08-11-2023, 10:19 AM
RE: Add a .js file and routes - by arna - 08-11-2023, 11:02 AM
RE: Add a .js file and routes - by arna - 08-11-2023, 07:03 PM
RE: Add a .js file and routes - by ozornick - 08-11-2023, 08:40 PM
RE: Add a .js file and routes - by arna - 08-11-2023, 09:20 PM
RE: Add a .js file and routes - by InsiteFX - 08-11-2023, 10:39 PM
RE: Add a .js file and routes - by ozornick - 08-12-2023, 12:50 AM
RE: Add a .js file and routes - by kenjis - 08-12-2023, 02:45 AM
RE: Add a .js file and routes - by arna - 08-12-2023, 04:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB