/    Sign up×
Community /Pin to ProfileBookmark

Body On load help

I have two scripts which run on the same page, both use external scripts.

Currently my body tag is:

<body onLoad=”initShipMethodModifier();” (then some font stuff)

I need to add this to the above:

<body onLoad=”modifyShipmethodForSoftgoods();”

Is it possible to combine these, and is it okay to run multiple scripts like this on the same page?

tks!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@BuilderQDec 03.2006 — No problem:

<body onload="initShipMethodModifier();modifyShipmethodForSoftgoods()"
Copy linkTweet thisAlerts:
@gizwebsauthorDec 03.2006 — awesome! Thank you very much!
Copy linkTweet thisAlerts:
@KorDec 03.2006 — The modern approach is to separate the content from style, behavior and structure. So that I suggest you to insert the event onload inside the javascript code, not in the BODY tag

<i>
</i>&lt;script type="text/javascript"&gt;

....code......

onload=function(){
initShipMethodModifier();
modifyShipmethodForSoftgoods()
}
&lt;/script&gt;
×

Success!

Help @gizwebs spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...