Solved

offline web application

Posted on 2014-03-25
3
130 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

937 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now