I am making remote ajax calls in my phonegap index.html file and the response is an html snippet including relative references to javascript, css and image files on the remote server. In order for the relative references to function properly I include a <base href="http://myserver.com" />
tag in my index.html file.
This works as expected.
However, I would like to also include local CSS/JS/Image files stored in the www directory of my Phonegap Application. As I set the base href to http://myserver.com I can no longer include them using relative URLs (e.g. <script src="phonegap.0.9.5.js"></script>
).
My question is: How can I reference these files?
I am hoping that something like this will work (as I am still posting this question, it is not quite that simple):
<script src="file:///www/phonegap.0.9.5.js"></script>
Thanks in advance!
Local images I reference with
./assets/img/img.png
and then when I am getting something on the server I remove the starting dot. So when I am testing my application, I use an asset_path variable that either has the dot or not (in your case you could put the full URL).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With