I am planning to create a responsive website using jquery/backbonejs.
my plan is to create a simple webapp to be used in phonegap (and deployed to android and iPhone via appstore/Google Play) which does only check what resources are on the server (via JSON) and download them all. after downloading them, i would like to jump to the folder having all the downloaded files and start from there.
Since iam not allowed to download files directly into my phonegap app folder, i guess i need to download the files into some kind of document folder used by the app. But the question is, is it possible to redirect from my phonegaps index.html to that other index.html in my documents folder having all the downloaded files. would it work linking to jquery.js and images being in that folder located in js/ or img/ ?
That way i could keep my app up2date, but it loads only if there is something missing or updated on the server.
Related
I have XAMPP and a separate cloud server. Inside XAMPP's htdocs there is a folder with a repository that I use to both develop, and push to the cloud server.
When using the same folder structure as the server ie. a script / js folder holding all the js files in the root of the folder (public_html/scripts) the server works fine.
The problem comes in development, where trying to access the scripts using src = "script/scriptname.js" gives me the error saying "Failed to load 404". Now I know it's just trying to search in localhost/scripts or htdocs/scripts rather than htdocs/projectname/scripts. I don't really want to have to move the script folder in and out all the time, as that's really tedious.
Is there any way to use a script folder without having to move it around in Xampp?
tl;dr: I want to include some JavaScript files from another project in another directory into a Cordova project, without (manually) copying those files into my Cordova project directory tree. How?
I am editing an existing Cordova project that makes use of some JavaScript source files originally written for a large web application project.
Currently, I am adding these source files by copying them to a subdirectory of the Cordova project, and by adding a <script> tag with the relative path to an index.html file in the Cordova project. This causes the JavaScript files to integrated in the deployed app, apparently by virtue of Cordova's (or Ionic's?) magic.
Now, it would be preferrable for me to avoid copying the JavaScript files to my Cordova project directory. Instead, I would like to directly link to the files in their original location rather than copying them (so updates from the web application get automatically applied to the Cordova project, as well).
As both the Cordova project and the large web application reside in the same VCS repository, the relative path to the files will always be the same - for the sake of an example, like this:
|-repository/
|-web/
| |-src/
| |-myCode.js
|-cordova
|-src
|-index.html
|-helpers
|-myCode.js // copy of /repository/web/src/myCode.js
Therefore, I have tried setting the relative path in the aforementioned index.html file - but unfortunately, Cordova seems to take over that file verbatim, and thus, the resulting URL will not exist (prompting a 404 error in the console, and causing the code from the file to be unavailable).
How can I have Cordova include and reference files from outside the directory hierarchy of a Cordova project?
Is there maybe at least a way to have Ionic or Cordova automatically copy the files into the Cordova project directory upon building the app?
I have Ubuntu 15.04 and i am working on a project using bootstrap i have kept the files in "/var/www/html", none of my files are able to access the javascript files when the page is rendered from Localhost. But I have tried to render same file from a desktop or home the Javascript files work fine.
You Should open the .html files using from a server like if you are using apache you can use localhost/yourfilepath.html. Otherwise External JS files will not open.
I am using Phonegap Build to build for IOS/Android. Just a test app at the moment but I am confused. I compress my app folder:
myApp/
config.xml
/www
index.html
index.js
myApp.zip <- I create the zip file at this level (only main files shown here)
My problem is, I have completely changed the index.html and index.js file, re-zipped the files, uploaded them to PhoneGap Build, but it insists on showing the original index.html file and executed the original index.js file. Locally, using the PhoneGap app on my iPhone I can see the changes when browsing on my ip address at :3000 but PhoneGap refuses to see that I've made a change. VERY frustrating. Anyone have any ideas how I can force PhoneGap Build to wake up and smell the coffee? I have completely deleted the app via the web interface and re-built and it STILL shows the old version. Any help appreciated,
thanks in advance,
Wittner
Ok I think this might be the answer. It's been a while since I worked with PhoneGap and I used a boilerplate code and structure for my tests. I moved the config.xml inside the www directory and compressed the files from inside it. Uploading this now works.
I have some files that I need to copy to a folder once the user has installed my app. I was trying to find a way to transfer the files directly from the application root directory but no luck. I had also seen a suggestion about zipping the files and including the zipped file in my package, then extracting them to the folder. But did not know how to implement either methods.
Another alternative is to download and install the files when the app starts, but didnt want to rely on having to maintain the files on a server or that the user always has internet access since my app can be run offline.
How do I do this with a Phonegap/JQM/Javascript app?
Thanks,
Robert