Forum Moderators: open
Consider the case of a webpage that communicates with a server using AJAX, and that this server suddenly crashes or becomes disabled in some way.
What are ways in which the clientside JavaScript can notify the admins of the problem with the server?
I am searching for failure notification techniques that require minimal action from the user, and would love to read your opinions on the matter.
(I'd prefer it if the user weren't involved at all, not even to click an OK button, but I don't see how this could be done. Even if a second server were available to receive the notification via AJAX and forward it to the admins, I understand that such a request to a second server would be blocked by the browser. But please correct me if I'm wrong here.)
I think the best solution is to pop up a dialog explaining the problem to the user and requesting that he/she sends a notification to the admins by clicking the OK button.
Granted many (maybe even most) users would be reluctant to click on the OK button.
But let's assume that a user decides to help out and clicks the OK button on this dialog.
Then what? How exactly does the JavaScript code then send the message to the admins?
I would greatly appreciate any light you may shed on this problem.
Thank you very much in advance!
kynn
[edited by: encyclo at 2:11 am (utc) on Jan. 31, 2008]
[edit reason] fixed thread title as per request [/edit]
The only problem is, to do that you'd need a server to send it to - but it would only do it if your server is down?
Maybe have the system on 2 servers so at least one would be up all the time.
Chris.
[Exception... "'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]
Line 0
I don't get the error when I replace the URL of the second server with the that of the original server. (I have not checked other browsers in great detail, but the preliminary results I have so far are consistent with my experience with Firefox. For example, in Safari the script fails, and in Opera it emits the error "Security violation".)
This suggests to me that browsers implement some control against cross-server communication.
(FWIW, both servers that I tried had identical domain names. I.e. they had names like server1.my.domain.com and server2.my.domain.com.)
If you know of a way to get around this control, please let me know the details. But I really don't think it is possible.
Thanks in advance,
Kynn