0

I have a HTML file which displays simple static content but I would like to display a number of youtube videos in iframes on this document, and I do know how to do this. What I want is to prevent these from loading ( and just display the static content ) if the browser is not connected to the internet. Is there any way to do this. I can use HTML, CSS, Javascript or jQuery

byronyasgur
  • 4,627
  • 13
  • 52
  • 96

2 Answers2

0

Check out online/offline events and the navigator.onLine property. If those are not available, you can only try to load the content and listen for errors (and view them only if loaded correctly).

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
0

navigator.onLine returns true for active network connection and false for offline!

spaceman12
  • 1,039
  • 11
  • 18