Ah the wretched noob I am, the following html document doesn’t alert anyone of my cry for help. Anyone know why?
<html>
<head>
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert('Somebody please help me.');
});
</script>
</head>
<body>
</body>
</html>
This works for me:
Just fixed the
srcin thescripttag.Edit: Actually, the original syntax would work fine if you load the page in a non-local context. Leaving out the protocol implies that the ‘current’ protocol would be used depending on whether resources are loaded over
httporhttps. Loading it locally implies that the script is loaded fromfile:///ajax.googleapis.com/...., which obviously won’t resolve to anything. See here for more information. Thanks to @PetrolMan for pointing to the HTML 5 boiler plate site.