Jquery语法错误但未突出显示
你好,我似乎在这个脚本的最后一行在 Dreamweaver 中遇到了一个错误,自从我在头部添加了一些 Jquery 初始化代码以来,它就出现了,但我似乎无法根据 Dreamweaver 的关闭脚本看到错误实际上在哪里标签是错误。
<script src="./ui/media/js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="./ui/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="./ui/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="./ui/media/js/TableTools.js" type="text/javascript"></script>
<!-- TinyMCE -->
<script type="text/javascript" src="./jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple",
editor_selector : "mceSimple"
});
tinyMCE.init({
mode : "textareas",
theme : "advanced",
editor_selector : "mceAdvanced",
theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink,Name,Rep,Date",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugins : 'inlinepopups',
setup : function(ed) {
// Add a custom button
ed.addButton('Name', {
title : '[Name]',
class : 'namebutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{name}');
}
});
ed.addButton('Rep', {
title : '[Rep]',
class : 'repbutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{createdby}');
}
});
ed.addButton('Date', {
title : '[Date]',
class : 'datebutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{datesent}');
}
});
</script>
<!-- /TinyMCE -->
<script src="./ui/media/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready( function() {
$('#dashboard').dataTable({
"bJQueryUI": true,
"bInfo": true,
"bAutoWidth": true,
"bFilter": true,
"bLengthChange": true,
"bPaginate": true,
"bProcessing": true,
"bSort": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 6, "desc" ]],
"iDisplayLength": 5,
"bLengthChange": false
});
});
</script>
Hi I seem to be getting an error in dreamweaver on the last line of this script, it has appeared since I added some Jquery initialisation code to the head, but I cant seem to see where the error actually is as according to dreamweaver the closing script tag is the error.
<script src="./ui/media/js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="./ui/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="./ui/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="./ui/media/js/TableTools.js" type="text/javascript"></script>
<!-- TinyMCE -->
<script type="text/javascript" src="./jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple",
editor_selector : "mceSimple"
});
tinyMCE.init({
mode : "textareas",
theme : "advanced",
editor_selector : "mceAdvanced",
theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink,Name,Rep,Date",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugins : 'inlinepopups',
setup : function(ed) {
// Add a custom button
ed.addButton('Name', {
title : '[Name]',
class : 'namebutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{name}');
}
});
ed.addButton('Rep', {
title : '[Rep]',
class : 'repbutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{createdby}');
}
});
ed.addButton('Date', {
title : '[Date]',
class : 'datebutton',
image : 'img/example.gif',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('{datesent}');
}
});
</script>
<!-- /TinyMCE -->
<script src="./ui/media/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready( function() {
$('#dashboard').dataTable({
"bJQueryUI": true,
"bInfo": true,
"bAutoWidth": true,
"bFilter": true,
"bLengthChange": true,
"bPaginate": true,
"bProcessing": true,
"bSort": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 6, "desc" ]],
"iDisplayLength": 5,
"bLengthChange": false
});
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的小型 mce 代码中缺少两个右大括号来关闭
tinyMCE.init
和setup: function(ed) {
:You are missing two closing braces in your tiny mce code to close the
tinyMCE.init
and thesetup: function(ed) {
:您的
tinymce
块中缺少一些右括号。试试这个:You were missing a few closing brackets in your
tinymce
block. Try this:您不能使用不带引号的单词class,因为它是保留关键字。
tinyMCE.init 末尾还缺少两个右括号和一个右括号。
You can not use word class without quotation marks because it is reserved keyword.
Also there are two missing closing brackets and one closing parenthesis on the end of tinyMCE.init.