Avatar of tntobey
tntobey
 asked on

Moving javascript to external file with body onload dependencies

Hi! I'm trying to move all of my javascript to an external file. I'm new to javascript and don't know how to get the dependent body onload and onunload to work with external .js. Here is where it works with the script in the page:
http://www.fortwayne2030.org/examplegmap3.html
Here is where I'm trying to separate the js:
http://www.fortwayne2030.org/examplegmap.html

Any help would be appreciated!
Thanks!
-TNT
Web Languages and StandardsJavaScriptJScript

Avatar of undefined
Last Comment
HonorGod

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
wuff1uk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
wuff1uk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
tntobey

ASKER
Oh my $%^&!  That whole time I was trying to get it to work I didn't have the .js uploaded. You were right, it was an empty file. Thanks! Also used the:
            <script type="text/javascript">
            onload = initialize();
            onunload = GUnload();
            </script>
SOLUTION
HonorGod

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
HonorGod

Thanks for the assist and the points.

Good luck & have a great day.
Your help has saved me hundreds of hours of internet surfing.
fblack61