Load new url in desktop deployment version

Develop and Deploy Native Apps for Windows, OS X, Linux, Unix ...
Post Reply
joedarock
Posts: 169
Joined: Thu Nov 19, 2015 8:39 pm

Load new url in desktop deployment version

Post by joedarock »

I have an app that I have to deploy as either a web version (runs in browser) or as a desktop exe. In the desktop version, the app still has to work in conjunction with a user-defined server, so I added an input box where the user can enter the url of the server. The server destination can be changed at any time by typing a new url in the box. I'm doing this using "window.location = myUrl". I find that if "myURL" is a valid site like "http://www.google.com", then the window reloads properly. However, if you type in some invalid url such as" http://www.nosuchsite.com", then it just displays a blank window titled "index.html".

Can you suggest what I might be doing wrong and how to do it properly so it handles invalid servers gracefully?

support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

Re: Load new url in desktop deployment version

Post by support »

I'm afraid You cant get cross domain info

joedarock
Posts: 169
Joined: Thu Nov 19, 2015 8:39 pm

Re: Load new url in desktop deployment version

Post by joedarock »

I don't understand your reply, or maybe you don't understand my question.

The browser version of my app runs fine in a browser that is pointed to a web server at say, www.xyz.com. The browser loads the app and runs it fine, no matter which server the browser points to.

If I compile a desktop version of the app. then I need to provide an input box where the user can fill in the url of the server the app should connect to. If a known valid url such as www.google.com is entered in the box, the app successfully loads Google. However, if an invalid server address is loaded, eg (www.nosuchserver.com, etc), the app just opens a blank window with the title "index.html" and goes no further.

There's no cross-domain stuff going on here (I think); I'm just asking the app to load a new page from a new server, but it doesn't like invalid servers.

Post Reply