0

I have a site which have a div in updatepanel, which is refreshed every 10 seconds, and I pass string result to div. If connection is dead, i get error that server is unavailable, which should not happen.

My question is, how to check clientside if connection is down, so I can just pass empty string to that div, and that page remains.

Thanks.

4

1 回答 1

1

看到这个:

检查是否存在使用 Javascript 的 Internet 连接?

如果您需要立即解决方案,可以使用以下方法:

var online = navigator.onLine;
于 2013-06-09T15:43:12.320 回答