i am using fetch to load a page code (html & js ) from another page then insert that code to be able to use it.
fetch('site.com')
.then(response=>response.text())
.then(data=>{ document.body.innerHTML += data })
after that i try to call a function called dosubmit() that's in the other page code but it gives me
dosubmit is not defined
even though that the request loaded successfully.