I would like to add a function to the Body Tag
onload=“myFunction()”
I don’t see where I can edit the Body Tag. Is this possible?
I would like to add a function to the Body Tag
onload=“myFunction()”
I don’t see where I can edit the Body Tag. Is this possible?
JQuery appears to work
<script>
$(myFunction());
</script>
What you can do is create a Script with the selector as body and then do the following as the script:
results.attr(“onload”, “myFunction()”);
I believe that should work.
Otherwise, like you realized you can just add scripts to your page.
If you want them to be added to to the <head>, you can create them as actual JavaScript resources and drag that new JS to your section. That’ll be more effective.
And also you can use jQuery to ensure that the script runs when everything else is done, even if the script is in the <head>.
$( document ).ready(function() {
console.log( "ready!" );
});
Just want to add that behavior for JS resources is different depending on the context type.
In a web context we add JS resource scripts to and leave execution to the browser, but in a print context we strictly control when JS resource scripts are executed. They are executed after the document is ready and before we run the scripts that are listed in the Scripts view.
We don’t allow users to link JS resources to an email section.