/    Sign up×
Community /Pin to ProfileBookmark

calling functions

Hey i’m a n00b so i’d like to know how you can call a function in another html page.

?

[color=red]thank you[/color]
[IMG]http://www.selfknowledge.org/whoweare/thanks.jpg[/IMG]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@guikApr 15.2003 — i don't understand what you really want to do

if you want to call a function that is written in a .js file( e.g. fct_menudiv.js) you should write:

<script language= "javascript" src="fct_menudiv.js">

</script> in your html head tag and then you can call each function that is in the .js file

if you want to write all your javascript code in your head tag:

<script language= "javascript" >

function hereitis(){

...........

}

</script>

and then you call it like before by writting hereitis()

e.g if you want to call that function while your page is loading you should write:<body onload="hereitis()">

is that enough?
×

Success!

Help @FredLabrosse 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 6.13,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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