Jquery语法错误但未突出显示

发布于 2024-12-24 22:02:44 字数 3028 浏览 4 评论 0原文

你好,我似乎在这个脚本的最后一行在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冬天旳寂寞 2024-12-31 22:02:45

您的小型 mce 代码中缺少两个右大括号来关闭 tinyMCE.initsetup: function(ed) {

<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 -->

You are missing two closing braces in your tiny mce code to close the tinyMCE.init and the setup: function(ed) {:

<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 -->
梅倚清风 2024-12-31 22:02:45

您的 tinymce 块中缺少一些右括号。试试这个:

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}');
            }
        });
    }
});

You were missing a few closing brackets in your tinymce block. Try this:

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}');
            }
        });
    }
});
抠脚大汉 2024-12-31 22:02:44

您不能使用不带引号的单词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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文