You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Returns true when cookie was found, false when no cookie was found...
62
-
$.removeCookie('the_cookie');
63
-
64
-
// Same path as when the cookie was written...
65
-
$.removeCookie('the_cookie', { path:'/' });
66
-
```
67
-
68
-
*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie, unless you're relying on the default options that is.*
69
-
70
-
## Configuration
71
-
72
-
### raw
73
-
74
-
By default the cookie value is encoded/decoded when writing/reading, using `encodeURIComponent`/`decodeURIComponent`. Bypass this by setting raw to true:
75
-
76
-
```javascript
77
-
$.cookie.raw=true;
78
-
```
79
-
80
-
### json
81
-
82
-
Turn on automatic storage of JSON objects passed as the cookie value. Assumes `JSON.stringify` and `JSON.parse`:
83
-
84
-
```javascript
85
-
$.cookie.json=true;
86
-
```
87
-
88
-
## Cookie Options
89
-
90
-
Cookie attributes can be set globally by setting properties of the `$.cookie.defaults` object or individually for each call to `$.cookie()` by passing a plain object to the options argument. Per-call options override the default options.
91
-
92
-
### expires
93
-
94
-
expires: 365
95
-
96
-
Define lifetime of the cookie. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` object. If omitted, the cookie becomes a session cookie.
97
-
98
-
### path
99
-
100
-
path: '/'
101
-
102
-
Define the path where the cookie is valid. *By default the path of the cookie is the path of the page where the cookie was created (standard browser behavior).* If you want to make it available for instance across the entire domain use `path: '/'`. Default: path of page where the cookie was created.
103
-
104
-
**Note regarding Internet Explorer:**
105
-
106
-
> Due to an obscure bug in the underlying WinINET InternetGetCookie implementation, IE’s document.cookie will not return a cookie if it was set with a path attribute containing a filename.
107
-
108
-
(From [Internet Explorer Cookie Internals (FAQ)](http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx))
109
-
110
-
This means one cannot set a path using `path: window.location.pathname` in case such pathname contains a filename like so: `/check.html` (or at least, such cookie cannot be read correctly).
111
-
112
-
### domain
113
-
114
-
domain: 'example.com'
115
-
116
-
Define the domain where the cookie is valid. Default: domain of page where the cookie was created.
117
-
118
-
### secure
119
-
120
-
secure: true
121
-
122
-
If true, the cookie transmission requires a secure protocol (https). Default: `false`.
123
-
124
-
## Converters
125
-
126
-
Provide a conversion function as optional last argument for reading, in order to change the cookie's value
127
-
to a different representation on the fly.
128
-
129
-
Example for parsing a value into a number:
130
-
131
-
```javascript
132
-
$.cookie('foo', '42');
133
-
$.cookie('foo', Number); // => 42
134
-
```
135
-
136
-
Dealing with cookies that have been encoded using `escape` (3rd party cookies):
137
-
138
-
```javascript
139
-
$.cookie.raw=true;
140
-
$.cookie('foo', unescape);
24
+
```html
25
+
<script>
26
+
$.getScripts({
27
+
urls: ['/path/to/one.js', 'path/to/two.js'],
28
+
cache:true, // Default
29
+
async:false, // Default
30
+
success:function(response) {
31
+
// Files have loaded
32
+
}
33
+
});
34
+
</script>
141
35
```
142
36
143
-
You can pass an arbitrary conversion function.
144
-
145
-
## Contributing
146
-
147
-
Check out the [Contributing Guidelines](CONTRIBUTING.md)
0 commit comments