采纳
var js = document.scripts; js = js[js.length - 1].src.substring(0, js[js.length - 1].src.lastIndexOf("/") + 1);
如路径为 https://www.orchome.com:8080/ABC/XX/a.js