Skip to content

Commit 93ce771

Browse files
committed
chore: update example, remove using polyfill because this lib includes polyfill now
1 parent 6f350cb commit 93ce771

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

example/basic.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
</style>
5252

5353

54-
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
5554
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/browser-image-compression@1.0.15/dist/browser-image-compression.js"></script>
5655
<script>
5756
document.querySelector('#version').innerHTML = imageCompression.version

example/development.html

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
</style>
5252

5353

54-
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
5554
<script type="text/javascript" src="../dist/browser-image-compression.js"></script>
5655
<script>
5756
document.querySelector('#version').innerHTML = imageCompression.version
@@ -96,15 +95,15 @@
9695
}
9796

9897
function uploadToServer (file) {
99-
const formData = new FormData()
100-
formData.append('image', file, file.name)
101-
const url = 'http://localhost:3000/image-upload-api'
102-
console.log('calling api', url, 'with data', Array.from(formData.entries())[0])
103-
return fetch(url, {
104-
method: 'POST',
105-
body: formData
106-
}).then(res => res.json())
107-
.then(body => console.log('got server response', body))
98+
// const formData = new FormData()
99+
// formData.append('image', file, file.name)
100+
// const url = 'http://localhost:3000/image-upload-api'
101+
// console.log('calling api', url, 'with data', Array.from(formData.entries())[0])
102+
// return fetch(url, {
103+
// method: 'POST',
104+
// body: formData
105+
// }).then(res => res.json())
106+
// .then(body => console.log('got server response', body))
108107
}
109108
</script>
110109
</body>

0 commit comments

Comments
 (0)