Skip to content

Commit 3efd023

Browse files
committed
- added comment
1 parent 50d5069 commit 3efd023

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

documentation/api.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,27 +216,31 @@ The utility library provides general functionality, which makes it easy to retri
216216

217217
**Example Usage**:
218218
```javascript
219-
if (Breinify.UTL.loc.paramIs(5, 'q', null, null, null, 'http://mydomain.com?page=5')) {
219+
if (Breinify.UTL.loc.paramIs(5, 'page', null, null, null, 'http://mydomain.com?page=5')) {
220220
window.alert('The parameter "q" is a number with the value 5.');
221221
}
222222
```
223223
<br/>
224224

225-
* {boolean} **Breinify.UTL.loc.parsedParam()**:<br/>
226-
Validates if the URL contains a specific parameter.
225+
* {boolean} **Breinify.UTL.loc.parsedParam(expectedType, param, paramListSeparator, paramSeparator, paramSplit, url)**:<br/>
226+
Parses the specified parameter to the expected type (i.e., *number*, *string*, *boolean*). If the parameter cannot be parsed, **null** is returned.
227227

228228
**Example Usage**:
229229
```javascript
230-
230+
var page = Breinify.UTL.loc.parsedParam('number', 'page', null, null, null, 'http://mydomain.com?page=search')
231+
if (page === null) {
232+
window.alert('Invalid parameter information.');
233+
}
231234
```
232235
<br/>
233236

234-
* {boolean} **Breinify.UTL.loc.param()**:<br/>
235-
Validates if the URL contains a specific parameter.
237+
* {boolean} **Breinify.UTL.loc.param(param, paramListSeparator, paramSeparator, paramSplit, url)**:<br/>
238+
Gets a specific parameter from the url. The function returns *null*, if the parameter does not exist.
236239

237240
**Example Usage**:
238241
```javascript
239-
242+
var page = Breinify.UTL.loc.param('page', null, null, null, 'http://mydomain.com?page=search')
243+
window.alert('The parameter "page" has the value "' + page + '".');
240244
```
241245
<br/>
242246

@@ -245,7 +249,7 @@ The utility library provides general functionality, which makes it easy to retri
245249

246250
**Example Usage**:
247251
```javascript
248-
252+
window.alert('You are visiting: "' + Breinify.UTL.loc.url() + '".');
249253
```
250254
<br/>
251255

0 commit comments

Comments
 (0)