Skip to content

Commit 305678e

Browse files
authored
Adding script tags for abort fetch snippet
1 parent d9fb768 commit 305678e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,14 +789,13 @@ const reduceRightArray = arr.reduceRight((acc, current) => {
789789
**[⬆ Back to Top](#table-of-contents)**
790790
### Abort Fetch
791791
792-
```javascript
793-
794-
795-
//HTML
792+
```html
793+
//html
796794
<button id="download">Download</button>
797-
<button id="abort">Abort</button>
795+
<button id="abort">Abort</button>
798796
799797
//JS
798+
<script type="text/javascript">
800799
let controller;
801800
802801
document.querySelector('#download').addEventListener('click', () => {
@@ -809,7 +808,7 @@ document.querySelector('#download').addEventListener('click', () => {
809808
document.querySelector('#abort').addEventListener('click', function() {
810809
controller.abort();
811810
});
812-
811+
</script>
813812
```
814813
815814

0 commit comments

Comments
 (0)