0

In my html template I load external files like this for stylesheet, javascript, etc:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />

Unfortunally sometimes I have to code off-line so I could load the files like this:

<link href="{% static 'css/bootstrap.min.css' %}" rel='stylesheet'> 

Is it possible to check the internet connection and choose which line to read (the first one if there is the connection, the second one if not)?

fabio
  • 1,210
  • 2
  • 26
  • 55
  • Open the links in the browser when you have an internet connection copy all the css and JS files to your local files and then link them to your website. or go through https://www.html5rocks.com/en/tutorials/appcache/beginner/ – Mohammed Wahed Khan Nov 13 '17 at 13:31
  • @Mohammed wahed khan I don't want to read always the local files, but only when the connection is off – fabio Nov 13 '17 at 13:40

0 Answers0