2012-01-04 72 views
0

您好我似乎在這個腳本的最後一行Dreamweaver出現錯誤,它已經出現,因爲我添加了一些Jquery初始化代碼頭,但我似乎無法看到哪裏錯誤實際上是因爲根據dreamweaver關閉腳本標記是錯誤。jquery語法錯誤,但沒有突出顯示

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

你可以很容易找到你自己縮進代碼的方案。 – 2012-01-04 11:44:57

回答

1

你缺少兩個封閉大括號中你的小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 --> 
2

,因爲它是保留關鍵字不能使用字不帶引號。 在tinyMCE.init的末尾還有兩個丟失的右括號和一個右括號。

+0

我是否必須引用整個事物或只是一個詞類,所以「類」: ? – 2012-01-04 11:38:43

+0

我已經爲課程的所有實例添加了引號,但它仍然表示僅在最後一行 – 2012-01-04 11:41:09

+0

上有錯誤,例如{'class':'namebutton'}; 最後一行的錯誤是由於丟失括號引起的。添加}});在之前,部分地你正在調用tinyMCE.init – 2012-01-04 11:42:20

0

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