This feature has been deprecated. Use up.request()
instead.
Load unpoly-migrate.js
to polyfill deprecated features.
Makes an AJAX request to the given URL and caches the response.
The function returns a promise that fulfills with the response text.
up.ajax('/search', { params: { query: 'sunshine' } }).then(function(text) {
console.log('The response text is %o', text)
}).catch(function() {
console.error('The request failed')
})
The requested URL.
Instead of passing the URL as a string argument, you can also pass it as an { url }
option.
See options for up.request()
.
A promise for the response text.