Step 1: Create a "js" Folder
Here's an example:
<script src="<?php echo base_url('js/myscript.js'); ?>"></script>
This code will load the "myscript.js" file from the "js" folder in your CodeIgniter application.
For example, you could add the following code to a view:
<script> alert('Hello World!'); </script>
This will display an alert box with the message "Hello World!" when the view is loaded in your browser.