Method ajax documentation
Creates an XHR object and returns the Promise.
Example
```javascript
// Promise
bbn.fn.ajax(
'my/location',
'json',
{id: 7},
d => {
console.log(d);
alert("Success!");
},
err => {
console.log(err);
alert("Failure!");
},
() => {
alert("Request aborted!");
}
)
```
Example
```javascript
// Promise
bbn.fn.ajax('my/location')
.then(
d => {
console.log(d);
alert("Success!");
}
)
.catch(
err => {
}
)
```
Creates an XHR object and returns the Promise. - Checks the URL, makes an ID, creates a loader, sets the general callbacks,
makes a POST if data is given a GET otherwise (GET data should be added
directly in the URL), and returns the Promise.
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions