@@ -6,6 +6,7 @@ You can see below the API reference of this module.
6
6
Finds the value of parameter passed in first argument.
7
7
8
8
#### Params
9
+
9
10
- ** String** ` name ` : The parameter name.
10
11
- ** Boolean** ` notDecoded ` : If ` true ` , the result will be encoded.
11
12
@@ -19,6 +20,7 @@ the parameter is there, but it doesn't have a value, the value will
19
20
be ` true ` .
20
21
21
22
#### Params
23
+
22
24
- ** String** ` search ` : An optional string that should be parsed (default: ` window.location.search ` ).
23
25
24
26
#### Return
@@ -28,6 +30,7 @@ be `true`.
28
30
Stringifies a query object.
29
31
30
32
#### Params
33
+
31
34
- ** Object** ` queryObj ` : The object that should be stringified.
32
35
33
36
#### Return
@@ -37,6 +40,7 @@ Stringifies a query object.
37
40
Adds, updates or deletes a parameter (without page refresh).
38
41
39
42
#### Params
43
+
40
44
- ** String|Object** ` param ` : The parameter name or name-value pairs as object.
41
45
- ** String** ` value ` : The parameter value. If ` undefined ` , the parameter will be removed.
42
46
- ** Boolean** ` push ` : If ` true ` , the page will be kept in the history, otherwise the location will be changed but by pressing the back button
@@ -50,6 +54,7 @@ will not bring you to the old location.
50
54
Returns the page url, but not including the domain name.
51
55
52
56
#### Params
57
+
53
58
- ** Boolean** ` excludeHash ` : If ` true ` , the location hash will not be appended in the result.
54
59
55
60
#### Return
@@ -59,8 +64,9 @@ Returns the page url, but not including the domain name.
59
64
Sets/gets the hash value.
60
65
61
66
#### Params
67
+
62
68
- ** String** ` newHash ` : The hash to set.
63
- - ** Boolean** ` triggerPopState ` : Triggers the popstate handlers (by default falsly).
69
+ - ** Boolean** ` triggerPopState ` : Triggers the hashchange (by default falsly).
64
70
65
71
#### Return
66
72
- ** String** The location hash.
@@ -69,6 +75,7 @@ Sets/gets the hash value.
69
75
Update the full url (pathname, search, hash).
70
76
71
77
#### Params
78
+
72
79
- ** String** ` s ` : The new url to set.
73
80
- ** Boolean** ` push ` : If ` true ` , the page will be kept in the history, otherwise the location will be changed but by pressing the back button
74
81
will not bring you to the old location.
@@ -77,11 +84,11 @@ will not bring you to the old location.
77
84
#### Return
78
85
- ** String** The set url.
79
86
80
- ### ` getLocation(pathname, push, triggerPopState) `
81
- pathname
87
+ ### ` pathname(pathname, push, triggerPopState) `
82
88
Sets/gets the pathname.
83
89
84
90
#### Params
91
+
85
92
- ** String** ` pathname ` : The pathname to set.
86
93
- ** Boolean** ` push ` : If ` true ` , the page will be kept in the history, otherwise the location will be changed but by pressing the back button
87
94
will not bring you to the old location.
@@ -90,19 +97,31 @@ will not bring you to the old location.
90
97
#### Return
91
98
- ** String** The set url.
92
99
100
+ ### ` triggerHashchangeCb() `
101
+ Calls the hashchange handlers.
102
+
93
103
### ` triggerPopStateCb() `
94
104
Calls the popstate handlers.
95
105
96
106
### ` onPopState(cb) `
97
107
Adds a popstate handler.
98
108
99
109
#### Params
110
+
111
+ - ** Function** ` cb ` : The callback function.
112
+
113
+ ### ` onHashchange(cb) `
114
+ Adds a hashchange handler.
115
+
116
+ #### Params
117
+
100
118
- ** Function** ` cb ` : The callback function.
101
119
102
120
### ` removeHash(push, trigger) `
103
121
Removes the hash from the url.
104
122
105
123
#### Params
124
+
106
125
- ** Boolean** ` push ` : If ` true ` , the page will be kept in the history, otherwise the location will be changed but by pressing the back button
107
126
will not bring you to the old location.
108
127
- ** Boolean** ` trigger ` : Triggers the popstate handlers (by default falsly).
@@ -111,6 +130,7 @@ will not bring you to the old location.
111
130
Removes the querystring parameters from the url.
112
131
113
132
#### Params
133
+
114
134
- ** Boolean** ` push ` : If ` true ` , the page will be kept in the history, otherwise the location will be changed but by pressing the back button
115
135
will not bring you to the old location.
116
136
- ** Boolean** ` trigger ` : Triggers the popstate handlers (by default falsly).
0 commit comments