Solved

offline web application

Posted on 2014-03-25
3
131 Views
Last Modified: 2014-04-02
Hi, on a incorporate web application, html/php/javascript - how can a custom error be displayed in the clients browser when network connectivity to web server hosting the app is lost. All pcs are running IE10/11. Javascript detects connectivity but cannot access a local file. appreciate some advise.
0
Comment
Question by:nevyana2006
3 Comments
 
LVL 34

Assisted Solution

by:gr8gonzo
gr8gonzo earned 250 total points
ID: 39953672
IE should be able to access a local file just fine using the file:// protocol as a URL:

C:\path\to\error_page.html =
file:///C:/path/to/error_page.html

//network_server/path/to/error_page.html =
file://network_server/path/to/error_page.html

Just create a custom error page, save it in the appropriate spot (either locally or on a centrally-shared server) and when Javascript detects the loss, just display an iframe with the src attribute set to the custom error page with that file:// URL.
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 250 total points
ID: 39961013
if the javascript is loaded, something like

document.write('connection lost');

or to write to a specific location

document.getElementById('id_of_box_that_will_contain_the_message').innerHTML=('connection lost');

you can also use modal windows, or simply alert() to display a message in js

--

if your js is loaded from the server and the server is down, simple answer is you can't

like mentioned above, hte browser can access a local file, and so can javascript through the httpquery() family functions. this requires that XSS pseudo-security does not get in the way
0
 

Author Comment

by:nevyana2006
ID: 39973351
thank you,
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question