Zeeshan Haider
Zeeshan Haider

Reputation: 42

JavaScript file is not working in codeigniter

    <script src="<?php echo base_url() ?>assert/js/bootstrap.js"></script>
    <script src="<?php echo base_url() ?>assert/js/bootstrap.min.js">
     </script>
    <script src="<?php echo base_url() ?>assert/js/jquery-2.1.1.js">
     </script>

I link css file same method and it is working, but js file are not working, how to slove this problem please help me.... when i BootstrapCDN link it working correct.

Upvotes: 0

Views: 1276

Answers (2)

you can try this:

add js in your page

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

Upvotes: 0

Danish Ali
Danish Ali

Reputation: 2352

Try this hope it will help you. Make sure you have already loaded the URL Helper

type="text/javascript"

<script type="text/javascript" src="<?php echo base_url('assert/js/bootstrap.js');?>"></script>

OR

<script type="text/javascript" src="<?php echo site_url('assert/js/bootstrap.js');?>"></script>

OR use CDN file

<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

Upvotes: 1

Related Questions