3

I have two projects - a demo project and an actual project. In the demo project, cordova.js (and all the rest of my js and CSS) load correctly. In the actual project, all the links to js and CSS are improperly formatted.

In the demo project, the link to cordova.js looks like (from the Safari inspector): enter image description here

In the actual & broken project, it looks like:

enter image description here

I've been searching and can't tell a difference between the projects. Why would the second project be using the wrong reference to the files?

crdzoba
  • 651
  • 1
  • 7
  • 20
  • cordova.js fie gets generated during the platform build. If this file could not be located, then it could be a possible build issue – Gandhi Apr 22 '16 at 05:59
  • Hi @crdzoba, Did you find any solution to this issue? – Biky Oct 19 '20 at 13:45

1 Answers1

4

Are you perhaps using Angular and have <base href="/"> in your index.html file?

If so you will need to remove it and go the URL hashing way. With Angular 2 you do this by adding { useHash: true } in your routing module. See https://angular.io/docs/ts/latest/guide/router.html#!#browser-url-styles for a good how-to and explanation.

With Angular 1 you configure the location provider. See https://docs.angularjs.org/guide/$location#hashbang-and-html5-modes for an explanation and how-to.

gwest7
  • 1,556
  • 19
  • 26