Building browser-only applications

Sometimes running the full-featured web server may be not desirable or even not possible. If that is the case, you might find Browser-only applications useful.

Note: it is expected that in the future with arrival of [HTML 5] the scope of browser-only XApps use will increase.


If No Web Server option is selected in Project Options dialog, the compiler will not include any server-side code and the compiled application will be just a set of HTML, Javascript and image files that can be hosted pretty much anywhere.

Limitations of Browser-only Applications

If you leave the server-side out, you lose everything that requires server-side processing. Database support, continuous forms, certain packages to name a few will not be available if you use Browser-only application.

Less obviously, you might encounter problems with calling certain web-services from the browser. This is due to the same origin policy restrictions imposed by the browser. Another example is all the HTML formatting events such as OnPrintHTML, OnPrintLoadingMessage, etc. These events are not available in a Browser-only application as they are defined and invoked on the server-side.

For example the browser code running within the forum.morfik.com domain can only access resources that are under morfik.com domain. The browser would not allow any code within the forum.morfik.com domain to access resources that are outside the general scope of the morfik.com domain (for example trying to call web services in www.google.com domain will fail).

This is not a problem for XApps that include server-side. For those web service calls are either made from the server-side (in which case there is no problem to begin with) or if they are made from the browser-side they get automatically routed through the server side (server side acting as a proxy).

Currently the only way to overcome this limitation in browser-only xApps is to setup a proxy server and route the web service calls to external sources through the proxy server.

Note: Services that have the same domain name but run on different ports are considered to be of different origins and therefore will fail the browser same origin test.

Deploying a Browser-only Application

Deploying a Morfik Browser-only application is a very straight forward process. Morfik Browser-only applications are entirely compiled into browser side code, making no assumptions on which platform they will be served from.

In fact the process of deploying the application can be reduced to the simple uploading of the files in the _ProjectNamePub ("Pub") folder and its sub-folders to a publicly accessible on the Web. This can be done with any simple FTP client software and the appropriate login information for the hosting server.

For example:

  • On deploying to an Apache web server you can upload the XApp's files and sub-folders to the httpd folder on the server or one of its sub-folders.
  • On deploying to a Microsoft Internet Information server you can upload the the XApp's files and sub-folders to the wwwroot folder on the server or one of its sub-folders.

Before deploying the files of your Morfik Browser-only application to the hosting server, be sure to compile the project as the files you see in the "Pub" folder may be from an earlier compilation and might not reflect your latest changes.