2

I have just ported my HTML5 app to Phonegap, that being I had a HTML5 app, and included it in the structure Phonegap requires.

I have a reference to css/js files in the index.html like so:

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

When I run "phonegap serve" the site runs fine, exactly the same as it did before - and it finds all the files. When I run "phonegap run ios" the application loads on my device but with no JS or CSS.

Inspecting the app in Safari shows the url of the resources are, for example, file:///css/app.css.

Why is it that when I serve the project it works but not on device?

Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97

1 Answers1

8

I found the answer was that someone had introduced

<base href="/">

and I needed

<base href=".">
Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97