Get started with intercooler-js CDN
MIT licensed
Intercooler.js is a bi-directional, real-time library for building modern web applications.
Tags:- ajax
- anchor
- attribute
Stable version
Copied!
How to start using intercooler-js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with intercooler-js CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/intercooler@1.2.3/intercooler.min.js"></script>
<style>
#response {
margin-top: 20px;
}
</style>
</head>
<body>
<button id="loadDataButton">Load Data</button>
<div id="response"></div>
<script>
const ic = new Intercooler();
ic.add({
target: '#loadDataButton',
endpoint: '/api/data',
method: 'GET',
onSuccess: function(response) {
document.getElementById('response').innerHTML = response;
}
});
document.getElementById('loadDataButton').addEventListener('click', function() {
ic.trigger('#loadDataButton');
});
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!