These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:04 pm Advanced search

Problem using jQuery with application caching

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Problem using jQuery with application caching

Postby wavicle » Tue Jul 13, 2010 8:49 am

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.
wavicle
<h6>
 
Posts: 1
Joined: Tue Jul 13, 2010 8:33 am

Re: Problem using jQuery with application caching

Postby mathias » Thu Sep 20, 2012 8:42 am

IIRC you need to list external resources in the `NETWORK` section explicitly to load them over the network:

Code: Select all
NETWORK:
*


To include them in the application cache, host `jquery.min.js` on your own server (same origin as the other files), and add it to the manifest file.
User avatar
mathias
<h6>
 
Posts: 2
Joined: Wed Aug 31, 2011 5:01 pm
Location: Belgium


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest