Thanks, Brittney,Since dojo.AddOnLoad has been depreciated, I'd like to write this using the newer version. However, I've tried using dojo/ready and the code ready(function () { dojo.byId("divDialogMessage").innerHTML = parameters.welcomeText; dijit.byId("dialogWelcome").show(); }); but that returns the error "TypeError: dijit.byId(...) is undefined"and trying "dom.byId("dialogWelcome").show();" give me the error "dom.byId(...) is null"
ready(function () { dojo.byId("divDialogMessage").innerHTML = parameters.welcomeText; dijit.byId("dialogWelcome").show(); });
ready(function () { divDialogMessage.innerHTML = parameters.welcomeText; dialogWelcome.show(); });
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>Splash Screen</title> <link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="https://community.esri.com//serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css"> <style type="text/css"> html, body { height: 100%; width: 100%; margin: 0; padding: 0px; font-family: helvetica, arial, sans-serif; font-size: 90%; } #mapDiv { margin: 0px; border: solid 1px #B5BCC7; height: 100%; width: 100%; } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="//serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script> <script> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.IdentityManager"); dojo.require("esri.IdentityManagerBase"); var map; function init() { map = new esri.Map("mapCanvas",{ center: [-107.394, 37.563], zoom: 9 }); esri.show(splashScreen); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer"); map.addLayer(basemap); dojo.connect(map, "onLoad", function() { //esri.hide(splashScreen); }); } function hideSplash(){ esri.hide(splashScreen); map.resize(); map.reposition(); } dojo.ready(init); </script> </head> <body class="tundra"> <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="position:relative;width:100%;height:100%;"> <div id="mapCanvas" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" style="height:900px;"> <div data-dojo-type="dijit/Dialog" id="splashScreen" title="Welcome" style="position: absolute; top: 300px; left: 400px; z-index: 100;width:600px"> <table class="dijitDialogPaneContentArea"> <tr> <td> <div id="divDialogMessage">This is the splash text</div> </td> </tr> </table> <div class="dijitDialogPaneActionBar"> <button id="buttonClose" data-dojo-type="dijit/form/Button" type="button" style="align-content: center" onclick="hideSplash();">Close</button> </div> </div> </div> </div> </body> </html>
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.