Don't know if this will help, but marking a script element with the defer
attribute would tell the browser that this code can safely wait until everything else is complete. That may have the effect that you are after.
- Code: Select all
Then in that block (which I guess could still be the in the head element), call the function to fill in your text fields.