所以,我以前从来没有使用过jQuery,但是有一个我想要的叫做Uniform的脚本,但是我似乎不能让它工作。在Safari调试器中,它给了我3个错误:
[Error] SyntaxError: Unexpected token '<' (jquery.js, line 1)
[Error] SyntaxError: Unexpected token '<' (jquery.uniform.js, line 1)
[Error] ReferenceError: Can't find variable: $
global code (index.php, line 8)下面是我的index.php文件的开头:
<html>
<head>
<title>PattersonCode.ca</title>
<link rel="stylesheet" type="text/css" href="/incls/style.css">
<script src="incls/jquery.js"></script>
<script src="incls/jquery.uniform.js"></script>
<script type="text/javascript">
$(function() {
$("select, input, a.button, button").uniform();
})
</script>
</head>使用完整URL (http://pattersoncode.ca/incls/uniform.jquery.js)解决了该问题
发布于 2013-07-06 09:18:55
可能是您的jquery路径错误或该文件夹中没有文件。
我建议使用带有回退代码的jquery CDN。
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='incls/jquery.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script src="incls/jquery.uniform.js"></script>https://stackoverflow.com/questions/17498631
复制相似问题