Semantic-UI, Uncaught TypeError: $(...).modal is not a function
Semantic-UI, Uncaught TypeError: $(...).modal is not a function
谁能解决这个问题,我无法使模式正常工作。浏览器控制台显示此错误:Uncaught TypeError: $(...).modal is not a function
我尝试取消注释 Query.noConflict();
和 jQuery(function($){}
,但没有任何区别。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/modal.min.css">
<link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/button.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<button class="ui button">Test</button>
<div class="ui modal my-dialog">
<i class="close icon"></i>
<div class="content">
<div class="description">
<div class="ui header">Text stuff here.</div>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Nope
</div>
<div class="ui positive right labeled icon button">
Yep, that's me
</div>
</div>
</div>
<script>
$( document ).ready(function() {
console.log( "document loaded" );
// jQuery.noConflict();
// Your jQuery code here, using the $
// jQuery(function($){
$('.ui.modal.my-dialog')
.modal('show');
// });
});
</script
</body>
</html>
您已包含插件的 CSS,但未包含其 JavaScript。您还需要包含 JavaScript(在包含 jQuery 的脚本标记之后)。
谁能解决这个问题,我无法使模式正常工作。浏览器控制台显示此错误:Uncaught TypeError: $(...).modal is not a function
我尝试取消注释 Query.noConflict();
和 jQuery(function($){}
,但没有任何区别。
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/modal.min.css">
<link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/button.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<button class="ui button">Test</button>
<div class="ui modal my-dialog">
<i class="close icon"></i>
<div class="content">
<div class="description">
<div class="ui header">Text stuff here.</div>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Nope
</div>
<div class="ui positive right labeled icon button">
Yep, that's me
</div>
</div>
</div>
<script>
$( document ).ready(function() {
console.log( "document loaded" );
// jQuery.noConflict();
// Your jQuery code here, using the $
// jQuery(function($){
$('.ui.modal.my-dialog')
.modal('show');
// });
});
</script
</body>
</html>
您已包含插件的 CSS,但未包含其 JavaScript。您还需要包含 JavaScript(在包含 jQuery 的脚本标记之后)。