jQuery插件没有加载?
我正在尝试使用jQuery的圆角演示(http://plugins.jquery.com/project/corners),但当Firefox和IE尝试运行时,我都遇到了一个错误 下面的代码显示了我正在尝试执行的操作,错误是“$(“.Section”)。corners不是函数”。页面肯定在加载jquery,但没有加载corners插件 有人知道这为什么会出错吗jQuery插件没有加载?,jquery,plugins,Jquery,Plugins,我正在尝试使用jQuery的圆角演示(http://plugins.jquery.com/project/corners),但当Firefox和IE尝试运行时,我都遇到了一个错误 下面的代码显示了我正在尝试执行的操作,错误是“$(“.Section”)。corners不是函数”。页面肯定在加载jquery,但没有加载corners插件 有人知道这为什么会出错吗 <script src="../../Content/Scripts/jquery-1.4.1.min.js" type="tex
<script src="../../Content/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../Content/Scripts/jquery.corners.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.Section').corners();
});
</script>
$(文档).ready(函数(){
$('.Section').corners();
});
使用Firebug(或同等开发工具)中的Net面板,首先确保加载脚本。如果没有,您应该看到它在网络面板中为其行项目返回404状态。使用Firebug中的网络面板(或等效开发工具),并确保首先加载脚本。如果不是,您应该看到它在网络面板中为其行项目返回404状态。应该是$('.Section').corner()代码>非$('.Section').corners()
这仅适用于使用“jQuery角落插件”的情况。应该是$('.Section').corner()代码>非$('.Section').corners()
这仅适用于使用“jQuery角落插件”的情况。我已经运行了您的代码,但没有发现问题所在。您可以在$(文档)中尝试此代码。准备好并查看它返回的内容:
alert(typeof jQuery().corners)
如果它提醒“功能”,则您知道角落正在加载。如果它警告“undefined”,则它不会加载,您可以跟踪该问题。我已经运行了您的代码,但看不出问题出在哪里。您可以在$(文档)中尝试此代码。准备好并查看它返回的内容:
alert(typeof jQuery().corners)
如果它提醒“功能”,则您知道角落正在加载。如果它警告“undefined”,则它不会加载,您可以跟踪该问题。我创建了一个页面来加载jQuery角落,以查看是否可以让它工作:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.Section {
border-color: #000;
border-width: medium;
border-style: solid;
}
</style>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jquery.corners.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.Section').corners();
});
</script>
<title>Corners</title>
</head>
<body>
<p class="Section">
Here is some text in my soon to be rounded corner paragraph.
</p>
</body>
</html>
.科{
边框颜色:#000;
边框宽度:中等;
边框样式:实心;
}
$(文档).ready(函数(){
$('.Section').corners();
});
角
下面是我即将结束的段落中的一些文字。
我在测试中发现,Corners插件已加载,但使用jQuery 1.4.4,并使用Chrome 8.0.552.224、Safari 5.0.3、Firefox 3.6.13和Internet Explorer 8进行测试,只有Safari和Fireefox显示了Corners。Chrome在控制台中产生了CSS错误,即忽略了JavaScript。考虑到这一点,我建议您为其他元素提供并使用一些组合CSS:
<style type="text/css">
.Section {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
}
</style>
.科{
-moz边界半径:20px;
-webkit边界半径:20px;
-khtml边界半径:20px;
边界半径:20px;
}
上面的CSS来自一个生成的示例。我创建了一个页面来加载jQuery角点,看看是否可以让它工作:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.Section {
border-color: #000;
border-width: medium;
border-style: solid;
}
</style>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jquery.corners.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.Section').corners();
});
</script>
<title>Corners</title>
</head>
<body>
<p class="Section">
Here is some text in my soon to be rounded corner paragraph.
</p>
</body>
</html>
.科{
边框颜色:#000;
边框宽度:中等;
边框样式:实心;
}
$(文档).ready(函数(){
$('.Section').corners();
});
角
下面是我即将结束的段落中的一些文字。
我在测试中发现,Corners插件已加载,但使用jQuery 1.4.4,并使用Chrome 8.0.552.224、Safari 5.0.3、Firefox 3.6.13和Internet Explorer 8进行测试,只有Safari和Fireefox显示了Corners。Chrome在控制台中产生了CSS错误,即忽略了JavaScript。考虑到这一点,我建议您为其他元素提供并使用一些组合CSS:
<style type="text/css">
.Section {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
}
</style>
.科{
-moz边界半径:20px;
-webkit边界半径:20px;
-khtml边界半径:20px;
边界半径:20px;
}
上面的CSS来自一个生成的示例。我使用的是同一个库,遇到了同样的问题,我所做的是
将corner.js
库的整个代码复制粘贴到文档之前。准备好代码并检查它是否开始工作
如果不是的话,corner.js应该重新下载。我使用的是同一个库,有同样的问题,我所做的就是
将corner.js
库的整个代码复制粘贴到文档之前。准备好代码并检查它是否开始工作
如果不是,那么应该再次下载corner.js
。您使用的是哪个corner脚本?您可以从浏览器访问corners.js文件吗?您使用的是哪个corner脚本?您可以从浏览器访问corners.js文件吗jquery脚本我无法确切地解释为什么corners脚本不起作用,但我能够在FF和IE中实现这一点。非常感谢@你能让什么工作?这个答案中提到的Jquery插件或角落?我不知道为什么角落脚本不能工作,但是我能够在FF和IE中工作。非常感谢@你能让什么工作?Jquery插件还是这个答案中提到的角落?