I have two app, let's call them "login" and "main". For some reasons, the whole project is divided in "login" and "main".

The two apps lays in two different urls.

What i'd like to do is to load the "main" app, when the login is successfull. How could i do?

I tried to do this:
                function() {
                function() {
but it doesn't work.

I mean, it loads the "main" app, but the old app is still visible. Last, the view is very ugly. hence i loaded also the css with the same tecnique. As result, some of the button still don't work.

has anyone of you an idea how i could deal with this problem?
thanks in advance.

ps: as stand alone app, the "main" app is working.
ps2: yes, i can do a redirect, but this creates a new problem. The new one is that the browser takes time while loading the new app and if the network is slow, it might be the case where the user sees a blank page for a minute. (while the browser is downloading the app)