0

我在 Salesforce 的静态资源中上传了我的 d3 版本 3 javascript 文件。但是当我试图在我的 javascript 中加载脚本时,面临资源未找到问题。

我能够加载 D3 V4 javascript 文件。但是当我尝试加载面临以下错误的 D3 V3 文件时。我只需要加载 d3 v3 脚本

在此处输入图像描述

加载 d3 v3 脚本的 Javascript 代码如下

加载 D3 V3 代码

4

1 回答 1

0

404 Not Found

What happens if you try to click the link in the line with error. It should take you to page where you can see JavaScript code. If it fails on such click - it'll also fail when requested from script.

Post more code, what's in "D3" variable. I suspect your zip file uploaded as static resource doesn't have just 3 files free-floating. They probably got zipped with the folder in which you had them so now either you repackage it or you build your path like D3 + '/somefolder/d3.v3.min.js'. Or maybe there's a typo in the filename.

Either way - click the link in the URL and keep experimenting in address bar until you manage to see the file, then adjust your code (or zip). Is it only the JS file that fails or CSS too?

于 2020-02-26T21:09:46.150 回答