Answer the question
In order to leave comments, you need to log in
Why doesn't the browser see the local file path?
Hello! I am creating an application on PhoneGap and faced the following problem.
The application does not see local files that are in the same folder. Those. there is index.html and css files or any other files in the same directory. here they are not loading. And when I insert it directly, let's say the style tag in index.html then it works. I tried just as easy to drop the folder with the application on the USB flash drive and open the same song through the browser, as if there were no files. Tell me what to do? Tested on Android 7.0
Answer the question
In order to leave comments, you need to log in
Use relative paths, not absolute ones.
For example, you have index.html, my.js, style.css files.
So in index.html you should write the following
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="./style.css" rel="stylesheet">
<script src="./my.js"></script>
</head>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question