语义 UI 评级组件在 MVC 4 应用程序中不起作用
Semantic UI rating component is not working in MVC 4 application
大多数语义 ui 组件在我的 mvc 应用程序中工作正常,但评级组件。
评分出现,但 onRate 功能不起作用。 API 文档提到 jquery 文件应该在语义 ui javascript.
之前加载
这是我的代码,我删除了不相关的东西
<html>
<head>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="rating.js"></script>
<link rel="stylesheet" type="text/css" href="rating.css">
</head>
<body>
<div> what </div>
<div class="ui star rating" data-rating="4"></div>
<script type="text/javascript">
$(document).ready(function(){
$('.ui.rating').rating();
});
</script>
</body>
</html>
我在这里使用了评级脚本和 css 文件。但我也尝试了语义-ui脚本和css,但没有成功。
我试过 "jquery-3.1.1.js" 而不是 "jquery-1.7.1.js" 并且 rating.js 工作正常。
大多数语义 ui 组件在我的 mvc 应用程序中工作正常,但评级组件。 评分出现,但 onRate 功能不起作用。 API 文档提到 jquery 文件应该在语义 ui javascript.
之前加载这是我的代码,我删除了不相关的东西
<html>
<head>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="rating.js"></script>
<link rel="stylesheet" type="text/css" href="rating.css">
</head>
<body>
<div> what </div>
<div class="ui star rating" data-rating="4"></div>
<script type="text/javascript">
$(document).ready(function(){
$('.ui.rating').rating();
});
</script>
</body>
</html>
我在这里使用了评级脚本和 css 文件。但我也尝试了语义-ui脚本和css,但没有成功。
我试过 "jquery-3.1.1.js" 而不是 "jquery-1.7.1.js" 并且 rating.js 工作正常。