-1

I am trying to load scripts from a database. These scripts from databases are being fetched after the document has been completely rendered. When I check the dom tree after the document has been completely loaded, the scripts that are being fetched from database are present, but are able to be executed

I know that a browser first executes the scripts files and after its turn the scripts from database have came into dom. Browser in unaware of these scripts and no executed. Is there any other way that I can to fetch the scripts from a database and still be able to execute these scripts

1 Answers1

0

you can get your data in body onload event or if you don't want to load script before rendering the page you can use webSoket to communicate to your Dom from backend server