This commit is contained in:
Suvodip
2024-08-31 18:29:35 +05:30
parent c5f3ddf301
commit c7d1ac2749

15
src/pages/test2.astro Normal file
View File

@@ -0,0 +1,15 @@
<div>
<button onclick="fetchData()">Fetch Data</button>
</div>
<script is:inline>
function fetchData(){
fetch(`https://dummy.restapiexample.com/api/v1/employees`)
.then(response => response.json())
.then(data => {
console.log(data)
})
.catch(error => {
console.error(error)
})
}
</script>