Equivalent method or "body onload" First, I have tried for several hours to weed through the various search results of the keywords above. I've found several things that seem to answer this but they're for Drupal 7; one of those was posted on 2012 and I am pretty sure things are gosh darn different now.
I am not a programmer, nor a web dev professional; I am just someone trying to update a very old site that worked fine but that needs to be re-freshen. I have some experience as a content manager with Drupal 6, but I have never got into coding, building modules, or editing template files. I am not afraid to copy a file, open it in an editor, change this or that, cut or paste, but I don't see myself being able to build a module to do this.
Maybe there's no way to do this &quot;easily.&quot;
I want to replicate a Google map with a custom search feature and some other tweaks. It works nicely in the existing site and it is basically 3 parts: a &lt;script&gt;code here&lt;/script&gt; in &lt;head&gt;, some HTML and script in the body,  and the following markup for &lt;body&gt;.
&lt;body onload=&quot;load(); curvycurvy()&quot; onunload=&quot;GUnload()&quot;&gt;

All I am hoping to do is properly add this code on my new Drupal 8 front page.  I've used the Asset Injector module to add the bulk of the script to &lt;head&gt; and used &lt;front&gt; to restrict it to the front page. I have chosen PHP for the content and it seems to retain the script.
Is there a way to add this code above into the body? Failing that, is there a way to provide similar functionality?
I was hoping that the Asset Injector has some tools like, &quot;Add to the Body Tag&quot; or such, that would have been exactly what I need.
This is fairly easy and covered well in the Javascript API section of the drupal docs.

Effectively you want a Javascript file that creates a Drupal behavior (this is automatically fired when the document is ready). Inside the behavior, just call curvycurvy();.

https://www.drupal.org/docs/8/api/javascript-api/javascript-api-overview

So, for starters...

Drupal.behaviors.initCurvy = {
  attach: function (context, settings) {
    curvycurvy();
  }
};