getBasePath 函数第三版
时间:2011-02-10 来源:司徒正美
//第一版链接:http://www.cnblogs.com/rubylouvre/archive/2010/04/06/1705817.html //第二版链接:http://www.cnblogs.com/rubylouvre/archive/2010/05/20/1739945.html //第三版:司徒正美 2011.2.10 var getBasePath = function(){ var url; try{ a.b.c() }catch(e){ url = e.fileName || e.sourceURL;//针对firefox与safari } if(!url){ var script = (function (e) { if(e.nodeName.toLowerCase() == 'script') return e; return arguments.callee(e.lastChild) })(document);//取得核心模块所在的script标签 url = script.hasAttribute ? script.src : script.getAttribute('src', 4); } url = url.substr( 0, url.lastIndexOf('/')); getBasePath = function(){ return url;//缓存结果,第一次之后直接返回,再不用计算 } return url; },
相关阅读 更多 +
排行榜 更多 +

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />
飞行射击 下载- 4 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载73.78MB · 95℃
1970-01-01
- 5 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载43.7 MB · 91℃
1970-01-01
- 6 <img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />下载110.69MB · 94℃
1970-01-01