Solved

offline web application

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article will show, step by step, how to integrate R code into a R Sweave document
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 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

18 Experts available now in Live!

Get 1:1 Help Now