/
index.html
66 lines (66 loc) · 2.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#wrapper{
margin: 0px auto;
padding: 20px;
width: 960px;
}
p{
font-size: 16px;
color: #000000;
}
.underline{
text-decoration: underline;
}
</style>
<title>fetch.js</title>
</head>
<body>
<div id="wrapper">
<p>fetch.js - A HTML5 link prefetching script that caches pages into
your browser for faster loading when you visit those pages. This script
should be fired when the page has fully loaded (window load) to prevent
any delays in initial DOM manipulations, event bindings etc. during
document load.</p>
<p class="underline">Usage</p>
<p>You'll need to include fetch.js along with jQuery.js like so...</p>
<pre>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="fetch.js"></script>
</pre>
<p>
Once you have that done you'll want to initialize fetch.js. You can
provide your own URLs to cache in array format in the first argument of
fetch.init like so...
</p>
<pre>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script src="js/fetch.js"></script>
<script type="text/javascript">
$(window).load(function () {
fetch.init(["http://www.SlickDeals.net", "http://www.ChicagoTribune.com", "and so on..."], true);
});
</script>
</pre>
<p>
and/or you can add the class 'fetch' to any anchor link tag in the
DOM and it will get picked up by the fetch script (by default this is
set to true, but if you want to turn this off you can switch the second
arguement to false)...
</p>
<pre>
fetch.init(["http://www.SlickDeals.net", "http://www.ChicagoTribune.com"], false);
</pre>
<!-- END WRAPPER -->
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script src="js/fetch.min.js"></script>
<script type="text/javascript">
$(window).load(function () {
fetch.init(["http://www.SlickDeals.net"], true);
});
</script>
</body>
</html>