1、使用 window.locaion.href 获得项目的根路径
var curWwwPath = window.document.locaion.href;
2、获得主机地址之后 的目录
var pathname= window.document.locaion.pathname;
var pos = curWwwPath.indexOf(pathname);
3、获得主机地址
var localhostPath = curWwwPath .substring(0,pos);
还有 js 调用 父页面的方法
window.parent.getMetho()