Appcelerator Titanium is pretty free with what it allows you to do, imposing very few restrictions to access. One thing that I did find it did not like you doing is accessing the Titanium API from a remote HTML file.

A Titanium app can load a file into a window using either the HTTP or the APP protocol. The APP protocol is a Titanium specific protocol which tells Titanium to reference the local resource folder for the page to display.

The crucial difference here is that a page loaded using APP is allowed to access the Titanium API and make calls to it freely. Pages loaded via HTTP cannot.

This means that if you have an HTML page sitting on a webserver somewhere, and it contains a call to the Titanium API, it will not work if you load that page into a Titanium window. The page will work normally if there are no Titanium calls.

So, what do you do when you want to have code sitting on a remote server that you want to be able to run in Titanium?

There is a very easy way in which to accomplish this.

The first step is to put any Javascript you want to run on the remote server into a JS file rather than directly in the HTML page.

Now, there is no way to get around having a local HTML page, so you would need to create a local HTML page, and then you can reference the remote JS file. For example:

      <script src="" language="Javascript">

The page will then load the Javascript, running it as if the page was loaded locally, while having (almost) all the code on the server.

This works very well for an application where the HTML page is used mainly as a frame for the Javascript which renders all the page elements.