Assets not found by Cordova / Phonegap

I just ported my HTML5 application to Phonegap since I had an HTML5 application and included it in the structure required by Phonegap.

I have a link to css / js files in index.html, for example:

<link rel="stylesheet" href="css/app.css"> <script src="js/app.js"></script> 

When I launch the β€œhandset”, the site works fine, exactly the same as before, and it finds all the files. When I run "connectgap run ios", the application loads on my device, but without JS or CSS.

Checking the application in Safari shows that the resource URL is, for example, the file: ///css/app.css.

Why, when I service the project, does it work, but not on the device?

+2
source share
1 answer

I found the answer that someone submitted

 <base href="/"> 

they do not need

 <base href="."> 
+7
source

Source: https://habr.com/ru/post/1012443/


All Articles