1

I'm trying to load my html page in a Firefox Panel. I've placed the HTML in the data directory. However, my HTML page contains absolute references to the CSS and JS and I noticed that the examples shown use relative references. Is there anyway to use absolute references? Thanks

4

1 回答 1

1

您应该只使用对文件的相对引用,因为(取决于 SDK 中资源 uri 路径的实现方式)使用完整资源 uri 可能会在 sdk 的未来版本中中断。

如果你绝对必须,你可以通过运行获得绝对路径:

var data = require("self").data;
var path = data.url("filename.jpg");
于 2012-06-21T04:13:17.183 回答