I am new to titanium mobile and I am a bit stuck. I have an app.js file and services.js file which sends some HTTP requests to an URI my issue is I want to create a global variable within the app.js which the services.js can use and other files as and when they get included.
What is the best way to do this ?
In PHP you would have a config file but how do you do in titanium mobile ?
If you are using services.js from a Ti.include, it will have access to everything declared in app.js. You usually create your own namespace and put ‘global’ variables in that:
Here is a more complete example from Aaron Saunders.