Get started with defiant.js CDN
MIT licensed
Defiant.js is a lightweight library for building accessible and fast form validators.
Tags:- json
- xpath
- xslt
- search
Stable version
Copied!
How to start using defiant.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with defiant.js CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/defiant.js/2.2.8/defiant.min.js"></script>
</head>
<body>
<button id="scanButton">Scan Page</button>
<div id="result"></div>
<script>
const scanButton = document.getElementById('scanButton');
const resultDiv = document.getElementById('result');
scanButton.addEventListener('click', () => {
defiant.scanDocument().then((report) => {
resultDiv.innerHTML = `<pre>${JSON.stringify(report, null, 2)}</pre>`;
}).catch((error) => {
resultDiv.innerHTML = `<p>Error: ${error.message}</p>`;
});
});
</script>
</body>
</html>
Copied!
Copied!