我有一个名为 index.html
的文件,它应该通过执行以下行来显示 map :Controller.startup(notauth);
。我已经确保逻辑符合这一行。
不知何故 map 不会出现,我在 Chrome 调试器中发现有一些调用错误的 JS 脚本路径。
这里我包含了我的 index.html
中的一些行:
<script type="text/javascript">
var dojoConfig = {
async: true,
packages: [{
name: 'viewer',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/viewer'
},{
name: 'config',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/config'
},{
name: 'gis',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/gis'
}]
};
</script>
<script type="text/javascript" src="http://10.255.1.77/sonar/arcgis_js_api/library/3.15/3.15/init.js"></script>
<script type="text/javascript">
//Get app ID from url
var file = 'config/viewer', s = window.location.search, q = s.match(/config=([^&]*)/i);
//alert ('var file ORI (config/viewer) : ' + file);
//alert ('nilainya Q : ' + q);
if (q && q.length > 0) {
file = q[1];
//alert ('Q1 : ' + file);
//alert ('S : ' + s);
if(file.indexOf('/') < 0) {
configfile = 'config/' + file;
}
//alert ('CONFIG-FILE : ' + configfile);
}
if (configfile == 'config/all')
{
//alert ('config == ALL');
//alert ('configfile is ' + configfile + ' -- strpathfile : ' + strpathfile);
if (ImgStatus && checkfileimg_js(strpathfile)) {
require(['viewer/Controller', configfile + '_imagery'], function(Controller, config){
Controller.startup(config);
});
}
else
{
alert ('controller.startup(notauth) Hellow NOAUTH ');
require(['viewer/Controller', 'config/all'], function(Controller, notauth)
{
Controller.startup(notauth);
});
}
}
else //IF configfile <> ALL (env,pims,clear dll)
{
Controller.startup(auth);
}
当我在 Chrome 中调试它时,我得到以下结果: - 结果 1:https://snag.gy/g37joA.jpg - 结果 1:https://snag.gy/aBMren.jpg
正确的路径应该是“http://10.255.1.77/sonar/arcgis_js_api/library/3.15/3.15/dijit/TitlePane.js” 不是 http://10.255.1.77/sonar/arcgis_js_api/library/3.15/dijit/TitlePane.js
那些 JS 来自哪里?我在我的 index.html 中找不到它们被调用。我在哪里以及如何找到调用这些 JS 脚本的行?
请帮忙
最佳答案
关于javascript - 如何找到这些JS文件的调用者?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54070466/