-
Dec 29th, 2024, 09:06 AM
#1
Thread Starter
Member
Fetch within a Fetch Issue
Just starting out with Javascript and ran into a problem when trying to execute a fetch within a fetch. Looking for a way to execute code once the first fetch completes. Using ‘then’ doesn’t seem to work as the call below to AjaxFileLoadInit() invokes a second fetch and locks things up. If I call AjaxFileLoadInit() later on after the first fetch has finished by way of a link everything works.
fetch(FileName)
.then(res => res.text())
.then(txt => Element.innerHTML = txt)
.then(txt => AjaxFileLoadJavaFix(Element))
.then(txt => AjaxFileLoadInit());
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|