conkis
<html>
 <head>
     <script>
         location.pathname.replace(/\/[^/]+$/,\'\'); //js获取当前项目跟目录
         alert(location.pathname);
         alert(location.pathname.replace(/\/[^/]+$/,\'\'));
     </script>
 </head>
 <body>
 
 </body>
</html>

 

分类:

技术点:

相关文章: