require([ "esri/map", "esri/config", "esri/dijit/HomeButton", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "esri/dijit/Scalebar", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/toolbars/draw", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/renderers/ClassBreaksRenderer", "esri/graphic", "dojo/_base/Color", "agsjs/dijit/TOC", "dojo/dom", "dojo/dom-style", "dojo/query", "dojo/parser", "dojo/on", "dojo/_base/connect", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/TitlePane", "dijit/form/CheckBox", "dijit/form/ComboBox", "dojo/parser", "dijit/Toolbar", "dijit/form/DropDownButton", "dijit/form/TextBox", "dojo/domReady!" ], function( Map, esriConfig, HomeButton, BasemapGallery, arcgisUtils, Scalebar, ArcGISDynamicMapServiceLayer, Legend, Geoprocessor, FeatureSet, Draw, SimpleFillSymbol, SimpleLineSymbol, Graphic, Color, ClassBreaksRenderer, TOC, dom, domStyle, query, parser, connect, on, registry ) {
actually you (at a minimum) have the same problem as the person above yourequire([ "esri/map", "esri/config", "esri/dijit/HomeButton", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "esri/dijit/Scalebar", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/toolbars/draw", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/renderers/ClassBreaksRenderer", "esri/graphic", "dojo/_base/Color", "agsjs/dijit/TOC", "dojo/dom", "dojo/dom-style", "dojo/query", "dojo/parser", "dojo/on", "dojo/_base/connect", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/TitlePane", "dijit/form/CheckBox", "dijit/form/ComboBox", "dojo/parser", "dijit/Toolbar", "dijit/form/DropDownButton", "dijit/form/TextBox", "dojo/domReady!" ], function( Map, esriConfig, HomeButton, BasemapGallery, arcgisUtils, Scalebar, ArcGISDynamicMapServiceLayer, Legend, Geoprocessor, FeatureSet, Draw, SimpleFillSymbol, SimpleLineSymbol, Graphic, Color, ClassBreaksRenderer, TOC, dom, domStyle, query, parser, connect, on, registry ) {
These are out of sync with each other. they have to match PERFECTLY, in order.
SO you added the "Legend" to the function, but not to the require.
So Geoprocessor is being aliased "Legend". FeatureSet is now "Geoprocessor" etc....
you have extra /section tags
(line 327)
did you download and add the TOC.js folder and files to your project?
ok i think you are skipping alot of steps
you need to download the agsjs package
in your project you should have (at least)
the agsjs folder
the TOC.js file
the css/TOC.css
the templates/tocNode.html and templates/tocNode_files/${_blankGif}
plus you need to add the agsjs to the packages of your dojoConfig