且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查我的c:\ abc \ abc.js上的.js文件是否已加载?

更新时间:2023-12-04 22:03:28

如果您通过HTTP服务器,这是在服务器端,没办法。



您无法使用具有此类位置的文件。您根本不能使用绝对路径名。 Web应用程序在沙盒环境中执行,不允许您访问站点根目录之外的任何文件。



即使你没有''使用任何服务器并只开发一组HTML / JavaScript文件(如文档),使用绝对路径是没有用的。远离麻烦。



-SA
If you work through the HTTP server, this is on the server side, no way.

You cannot use the file with such location. You cannot use absolute path names at all. A Web application is executed in sandboxed environment which won''t allow you to access any files beyond the root directory of your site.

And even if you don''t use any server and develop just a collection of HTML/JavaScript files (such as documentation), using of absolute paths just cannot be useful. Stay out of trouble.

—SA