为什么我无法使用codeigniter访问外部javascript文件,即使它们已加载?
我的项目是使用引导和Codeigniter的组合。我无法访问外部javascript文件中的函数。使用Firefox中的firebug,我可以看到这些外部脚本被加载。外部css文件工作正常。请注意,jquery可以工作,但我怀疑这是因为jquery.js文件包含在目录assets/js/jquery.js中的Bootstrap/Codeigniter框架中 以下是我在每个Codeigniter视图中的标题代码:为什么我无法使用codeigniter访问外部javascript文件,即使它们已加载?,javascript,jquery,jquery-ui,codeigniter,Javascript,Jquery,Jquery Ui,Codeigniter,我的项目是使用引导和Codeigniter的组合。我无法访问外部javascript文件中的函数。使用Firefox中的firebug,我可以看到这些外部脚本被加载。外部css文件工作正常。请注意,jquery可以工作,但我怀疑这是因为jquery.js文件包含在目录assets/js/jquery.js中的Bootstrap/Codeigniter框架中 以下是我在每个Codeigniter视图中的标题代码: <!DOCTYPE html> <html lang="en"&g
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/img/icons/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/icons/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/icons/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/img/icons/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="/img/icons/favicon.png">
<title>Sample Website</title>
<!-- Bootstrap core CSS -->
<link href="/dist/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
<!-- Custom styles for this template -->
<link href="/css/theme.css" rel="stylesheet">
<link href="/css/carousel.css" rel="stylesheet">
<!-- styles custom to our site -->
<link href="/css/style.css" rel="stylesheet">
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
</head>
样本网站
尝试在url之前添加基本url:
<script type="text/javascript" src="<?= base_url();?>js/jquery.cookie.js"></script>
你只有3
jQuery
文件,你提到jQuery
有效,那么还有什么呢?在-->
之间,这是一个打字错误吗?是的,这是一个输入问题框的打字错误…我删除了它css和jQuery有效,但jQuery UI和jQuery cookie无效…我已经尝试了另一个外部输入javascript文件,但只有在我将文件内容复制到当前页面时,它才会工作