简体   繁体   中英

How can I get this relative path working in javascript?

I have a folder structure like this

  • lots of folders
    • another subfolder
      • _includes
        • getStatisticsTable.php
      • _templates
        • StatisticsWrapper.html

In StatisticsWrapper.html I'm using jQuery's .get() function to get some external data that should be made using getStatisticsTable.php but when I use the relative path: " ../_includes/getStatisticsTable.php " it doesn't work.

My guess was that it's not working because the file StatisticsWrapper.html is being included by another file in a lower folder, so I tried making the path relative to that folder but it's not working.

From where should I search for the getStatisticsTable.php ? Is there an easy way to find out where the file is searching from?

尝试使用document.location.href发现您的位置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM