Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JS文件不工作CodeIgniter_Javascript_Php_Codeigniter - Fatal编程技术网

Javascript JS文件不工作CodeIgniter

Javascript JS文件不工作CodeIgniter,javascript,php,codeigniter,Javascript,Php,Codeigniter,所以,是的,我在这里搜索了相当长的一段时间后,我告诉自己,是时候发布了,而不是 我在本地主机上安装了CodeIgniter,我正在使用WAMP服务器 我已经把它放在constants.php define('URL','http://localhost/ci/'); define('IMG',URL.'assets/images/'); define('CSS',URL.'assets/css/'); define('JS',URL.'assets/js/'); <script type

所以,是的,我在这里搜索了相当长的一段时间后,我告诉自己,是时候发布了,而不是

我在本地主机上安装了CodeIgniter,我正在使用WAMP服务器

我已经把它放在constants.php

define('URL','http://localhost/ci/');
define('IMG',URL.'assets/images/');
define('CSS',URL.'assets/css/');
define('JS',URL.'assets/js/');
<script type="text/javascript" href="<?php echo(JS.'custom.js'); ?>"></script>
然后,我把它放在我的视图site_header.php

define('URL','http://localhost/ci/');
define('IMG',URL.'assets/images/');
define('CSS',URL.'assets/css/');
define('JS',URL.'assets/js/');
<script type="text/javascript" href="<?php echo(JS.'custom.js'); ?>"></script>
但不幸的是,我没有收到警报。我对CodeIgniter真的很陌生,我几天前刚刚安装了它,如果有人能回答我的问题,那将非常有帮助


谢谢。

应该编辑
href
src


尝试像这样放置
@unlockdluca,因此您希望我删除
type=“text/javascript”
,完成,但它仍然不起作用..对于脚本,它不是href。。它是src。。只要在W3学校读一读那一章,我想你在那之后会没事的,而不是我的天啊,我真愚蠢,竟然忘了最基本的东西。Thanks..@Shaftqat Jan这是错误的,因为
URL=http://localhost/ci/
JS=URL.'assets/JS/'
因此,
http://localhost/ci/http://localhost/ci/assets/js
。。。