<html>
<head>
<script>
location.pathname.replace(/\/[^/]+$/,\'\'); //js擷取目前項目跟目錄
alert(location.pathname);
alert(location.pathname.replace(/\/[^/]+$/,\'\'));
</script>
</head>
<body>
</body>
</html>
<html>
<head>
<script>
location.pathname.replace(/\/[^/]+$/,\'\'); //js擷取目前項目跟目錄
alert(location.pathname);
alert(location.pathname.replace(/\/[^/]+$/,\'\'));
</script>
</head>
<body>
</body>
</html>