I tried putting all code together in notepad, so it would work offline, not in codecademy site. I copied all code exactly as it was, there was index, style and js file. Even added jQuery CDN to my html file but it still don’t work.
It’s even possible to do so? How do I get that jQuery works?
@enzee// defaults to the current protocol. So if you’re on an HTTPS page, it’ll load the asset from an HTTPS URL (if possible), and if it’s an HTTP page, it’ll be loaded with the HTTP protocol. It sounds great, but it shouldn’t be used.
The problem though, is that you’re accessing your HTML file using the file protocol (file:///whatever/index.html), but file is only for local resources. So HTTP(S) pages can’t access resources using the file protocol.
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<!-- what's this one for? you already have a link to jquery-->
<script src="script.js"></script> <!-- ← `type="text/javascript"` is optional; i prefer to remove it -->
@enzee// is still commonly used since most people don’t know better, so that’s not a mistake, just a case of not knowing any better on their part.
For the second <script> though, I’m wondering about that. It doesn’t seem like the official jQuery site would recommend you have two links to different versions of jQuery right beside each other for no obvious reason