- Code: Select all
<html manifest="cache.manifest">
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
$(document).ready(
function() {
alert("jQuery was loaded and is working");
}
);
</script>
</head>
<body>
</body>
</html>
Consider the above code. I am using a manifest file to cache some resources, and I am loading jQuery externally.
It works the first time, and every other time, it says "$ is not defined", meaning that it cannot use jQuery after the cache manifest is once consumed.
Any leads on why this happens? FYI, I also tried hosting and caching the JS file within the manifest and still the same problem persists.