|
|
|
|
|
by guessmyname
2987 days ago
|
|
Years ago, I used to link the library from Google [1] or CloudFlare [2]. Nowadays, with all the Node.js stuff that goes around modern front-end, I don't see the point of embedding a JavaScript library from a CDN, unless that library is dependent on a remote service, e.g. Google Analytics, Google Maps, etc… That being said, if you are still maintaining a legacy website that depends on jQuery, you should consider to embed the library like this instead: <script>window.jQuery || document.write('<script src="/js/jquery.min.js"><\/script>')</script> [1] https://developers.google.com/speed/libraries/ [2] https://cdnjs.com/libraries/jquery |
|
What does Node.js have to do with deciding whether to get your static assets from a public CDN or not? I hope your not serving your static assets with Node.js.