ASP.NET WebForm,找不到Nouislider
我正在尝试在ASP.NET网站中使用Nouislider创建一个基本的滑块(这是我们使用的,无论好坏)。我们目前正在使用jQuery UI滑块,并且不支持触摸事件。
无论我尝试什么,我都会在testnouislider:39:17'错误的“ nouislider.create.create”系列中定义一个“未接收参考:Nouislider”。
网页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestNoUISlider.aspx.cs" Inherits="TestNoUISlider" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="Content/noUiSlider/jquery.nouislider.css" rel="stylesheet" />
<script src="Scripts/jquery-3.6.0.min.js"></script>
<script src="Scripts/jquery.nouislider.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<h1>Test the no ui slider</h1>
<div>
<br />
<br />
<br />
</div>
<div id="slider"></div>
</div>
</div>
</form>
<script>
var slider = document.getElementById('slider');
noUiSlider.create(slider, {
start: [20, 80],
connect: true,
range: {
'min': 0,
'max': 100
}
});
</script>
</body>
</html>
根本没有代码。以上是从( nuislider网站)的
任何积极建议。
I'm trying to create a basic slider with nouislider in an ASP.NET website (that's what we use, for better or worse). We're currently using the JQuery UI slider and it doesn't support touch events.
Whatever I try I get an 'Uncaught ReferenceError: noUiSlider is not defined at TestNoUISlider:39:17' error at the 'noUiSlider.create' line.
Web page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestNoUISlider.aspx.cs" Inherits="TestNoUISlider" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="Content/noUiSlider/jquery.nouislider.css" rel="stylesheet" />
<script src="Scripts/jquery-3.6.0.min.js"></script>
<script src="Scripts/jquery.nouislider.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<h1>Test the no ui slider</h1>
<div>
<br />
<br />
<br />
</div>
<div id="slider"></div>
</div>
</div>
</form>
<script>
var slider = document.getElementById('slider');
noUiSlider.create(slider, {
start: [20, 80],
connect: true,
range: {
'min': 0,
'max': 100
}
});
</script>
</body>
</html>
There are no code behind at all. The above is taken straight from the (nuislider website)
Any positive suggestions much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
名称
jquery.nouislider.js
建议使用旧版本的Nouislider,它是jQuery插件。它不再是,并且您从文档中使用的代码反映了这一点。尝试下载最新版本的Nouislider。您不需要JQuery才能使用它。The name
jquery.nouislider.js
suggests using are using an older version of noUiSlider, which was a jQuery plugin. It no longer is, and the code you are using from the documentation reflects that. Try downloading the latest version of noUiSlider. You won't need jQuery to use it.