简体   繁体   中英

Search doesn't work on php file

I am testing some basic searching on tables without the use of database yet.

The problem is the search is working in the HTML file but failed to work on php file(I am using codeigniter framework).

This is the code on both html file:

 <script src="js/search.js"></script>

THis is the code on my CI php VIEW file:

script type="text/javascript" src="application/views/ui/js/search.js">

My htaccess file on the views:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /webs/BCI/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

My base_url function works on my css files, but it just won't load my JS files located on my js folder. Are there any more configurations needed to load a js file?

You have to store all css , js and image file under public_html folder. And call your file like-

<script src="<?php echo base_url(); ?>js/search.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM