Javascript error: function not defined????

62258
12
Jump to solution
08-26-2013 08:24 AM
by Anonymous User
Not applicable
however it IS defined....here:

require(["dojo/dom",
        "dojo/_base/array",
        "dojo/_base/Color",
        "dojo/parser",
       
...

],

function(dom, array, Color, parser, Map, esriLang, Graphic, FeatureLayer, InfoTemplate, GraphicsLayer, SimpleRenderer, Point, FeatureSet,
             ClosestFacilityTask, ClosestFacilityParameters, SimpleMarkerSymbol, SimpleLineSymbol){   
   
      var map, incidentsGraphicsLayer, routeGraphicLayer, closestFacilityTask, params, facilitiesFeatureLayer, handler;
  

    function myFunction() {
      alert("Do Something");
    }

});

<body class="claro">  
...


<div> <button onClick="myFunction()">Pick Point</button></div>
</body>
</html>
0 Kudos
12 Replies
by Anonymous User
Not applicable
Try this:

Add value as property:
[HTML]<input id="toolBuffer" data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'findNear', showLabel: false, value: 'buff'"></button>[/HTML]

Use .get('value') to get the value:
dom.byId('toolBuffer').get('value');


Throws this error:

Uncaught TypeError: Object #<HTMLSpanElement> has no method 'get'
0 Kudos
BenFousek
Occasional Contributor III
Sorry...use dijit.byId because it's a widget.

dijit.byId('toolBuffer').get('value');
0 Kudos
by Anonymous User
Not applicable
Sorry...use dijit.byId because it's a widget.

dijit.byId('toolBuffer').get('value');


That was it....

Thanks!

rGibson
0 Kudos