0
我試圖找到我的工作目錄使用JavaScript的實際路徑。我從這個職位 How to get the absolute path of the current javascript file name如何獲得實際的Windows路徑使用javascript
<script>
alert(location.pathname); // /tmp/test.html
alert(location.hostname); // localhost
alert(location.search); // ?blah=2
alert(document.URL); // http://localhost/tmp/test.html?blah=2#foobar
alert(location.href); // http://localhost/tmp/test.html?blah=2#foobar
alert(location.protocol); // http:
alert(location.host); // localhost
alert(location.origin); // http://localhost
alert(location.hash); // #foobar
</script>
讀,但他們沒有,我一直在尋找,因爲我想找到例如「C:/ XAMPP/htdocs中/ myCurrentDirectory」的路徑。那麼如何做到這一點......?
在此先感謝... :)
Oooowh .... Okiee ..非常感謝您的信息.. :) –