日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ArcGIS中加载模块时dojo/domReady!和dojo/ready的区别

發(fā)布時(shí)間:2025/3/21 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ArcGIS中加载模块时dojo/domReady!和dojo/ready的区别 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

我們?cè)谑褂肁rcGIS Javascript? API開發(fā)時(shí),最開始要先加載模塊:

<script>require(["esri/map", "dojo/domReady!"], function(Map) {// code to create the map and add a basemap will go here}); </script>

這里有個(gè)dojo/domReady!,另外Dojo還有一個(gè)dojo/ready,這倆有啥區(qū)別呢,esri官網(wǎng)上有這么一段:

The difference between?domReady?and?ready?is that the former waits to fire the callback provided to?require?until the DOM is available while the latter waits for the DOM to be ready?and?waits for all outstanding require calls to finish. For more information, see the?Dojo documentation for dojo/ready. In simple cases,?dojo/domReady!?should be used. If an app uses?parseOnLoad: true, Dojo Dijits, widgets from the Esri library or custom dijits,?dojo/ready?should be used.

翻譯過來就是,domReady是等待所有DOM元素加載完成,再require相關(guān)模塊;而ready是等待DOM元素加載以及require的相關(guān)模塊全部加載完成。在一些簡(jiǎn)單應(yīng)用場(chǎng)景,用dojo/domReady!就行了;如果應(yīng)用里需要用到一些組件,微件之類的還是用dojo/ready.

總結(jié)

以上是生活随笔為你收集整理的ArcGIS中加载模块时dojo/domReady!和dojo/ready的区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。