last day (19 days later) » 

6:24 PM
0
Q: Access to PhoneGap's API from a script hosted externally

Click UpvoteIf you include an external <script> in your www/index.html file, can that script still access PhoneGap's API / plugins? For example, if this is the content of your www/index.html file: <html> <head> <script src="http://myapp.com/app.js"></script> </head> </html> Would all of PhoneGap's APIs...

 
Are you asking if the actual Javascript file would be able to access those scripts or just the html file?
 
@toggy-tog-togs the javascript file.
 
As long as the paths are correct and they are available externally then yes.
 
@toggy-tog-togs So, http://myapp.com/app.js would be able to access phonegap's camera plugin api, address book api, etc?
 
Yes! As long as all the file paths are relevant to were the file is and to were it is trying to access them from.
 
6:24 PM
@toggy-tog-togs Which file paths are you referring to?
 
Well how are you trying to access the API?
 
@toggy-tog-togs To be honest, I'm just getting started with PhoneGap. I assumed that you just access the apis through javascript, e.g window.camera?
 
Hi I just moved this to a discussion as it has become rather lengthy...
 
sure
 
Do you already have the library imported within the same page the Javascript file is?
 
6:30 PM
I'm not sure what you mean, I just run cordova build and it makes an app using the files in www directory
so if i have www/app.js then i just have to do <script src=app.js> and then app.js can access the phonegap api's right.
so instead if I put app.js on a site, like myapp.com/app.js, could it keep accessing the api the same way?
 
6:44 PM
dude?
 

  last day (19 days later) »