var js = document.scripts; js = js[js.length - 1].src.substring(0, js[js.length - 1].src.lastIndexOf("/") + 1);
如路径为 http://localhost:24395/ABC/XX/a.js
结果会得到 http://localhost:24395/ABC/XX/
时间: 2024-10-27 18:25:42
var js = document.scripts; js = js[js.length - 1].src.substring(0, js[js.length - 1].src.lastIndexOf("/") + 1);
如路径为 http://localhost:24395/ABC/XX/a.js
结果会得到 http://localhost:24395/ABC/XX/