Can't link to external file using PhoneGap Build

I can’t link to external files (CSS / JavaScript) when they are in the parent folder of the HTML file using PhoneGap Build .

The following example works great:

<link rel="stylesheet" href="teste.css" />

      

But if you move the file to the parent level, it won't load it.

<link rel="stylesheet" href="../teste.css" />

      

or

<link rel="stylesheet" href="./../teste.css" />

      

+3


source to share


2 answers


I debuted the app using weinre and noticed that PhoneGap is considered root as the folder where index.html was located



As I said, I redesigned my web application structure so that index.html is located in the parent folder.

0


source


just a guess, but if you are using jQuery mobile I assume you are using ajax as part of it. Now if this ajax loads the page to another page that is in the root of your application, it means that technically that page no longer lives in a subfolder, so the file should just reference the parent css as if it were included in the root. It makes sense?

but not

<link rel="stylesheet" href="../teste.css" />

      



just keep

<link rel="stylesheet" href="teste.css" />

      

0


source







All Articles