CDN with fallback

CDN with fallback

sleepingtigersleepingtiger Posts: 13Questions: 8Answers: 0
edited October 2014 in Free community support

(sorry allan for so many stupid posts)

two points:

  1. The css files in CDN should have images embedded i think (base64) so i could take advantage of CDN otherwise paths reference locally...
  2. Please confirm that the following would be a good solution to fallback locally if cdn not working:
<link rel="stylesheet" type="text/css" href="<%=this.ResolveUrl("~/Controls/Dashboard/JS/DataTable/css/jquery.dataTables.css") %>"><br />
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.js"></script>
<script type="text/javascript">
    jQuery.fn.dataTable || document.write('<script type="text/javascript" src="<%=this.ResolveUrl("~/Controls/Dashboard/JS/DataTable/jquery.dataTables.min.js") %>"></script>')
</script>

Answers

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Hi,

    .1. The css files in CDN should have images embedded i think (base64)

    Yes. I've avoided doing that for compatibility with IE6 and 7 which are still supported in DataTables 1.10 (although support will be removed in v1.11). I will look into providing a star hack version of the CSS with this.

    otherwise paths reference locally...

    CSS paths are local to the imported url.

    .2. Please confirm that the following would be a good solution to fallback locally if cdn not working

    Looks fine to me.

    Allan

This discussion has been closed.