Reputation: 1643
In my HTML page i want to load the following CDNjs
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
but in the browser it loads as follows
GET http://localhost:8080/cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js 404 (Not Found)
Now, my question is how to eliminate that attaching the Domain name(localhost:8080) to load my script properly. I also tried it as
<script src="../cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
or
<script src="../../cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
But the result is same.
Thank you.
Upvotes: 2
Views: 1323
Reputation: 1160
Check the examples in tether I found sample here we are using as below, which you can modify to cdnjs link. I recommend to open in incognito mode.
There are several ways to execute an external script:
example:-
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js" async></script>
example:-
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js" defer></script>
example:-
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
Upvotes: 1
Reputation: 1671
check following line.
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js" async></script>
Upvotes: 1
Reputation: 2706
You need to use the FQDN to CloudFlare. You are doing a relative path lookup currently.
You should not unclude https: here, use // and the browser wil auto-detect. i.e.
<script src="//cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
Upvotes: 1
Reputation: 2308
You should use following way to include the cdn file.
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
Upvotes: 0