Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

offline web application

Posted on 2014-03-25
3
Medium Priority
?
137 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 35

Assisted Solution

by:gr8gonzo
gr8gonzo earned 1000 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 27

Accepted Solution

by:
skullnobrains earned 1000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…
Suggested Courses

972 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