/    Sign up×
Community /Pin to ProfileBookmark

one piece js call another piece of js

I have comon.js and one.js , two .js I want my one .js and two.js involve the validation function inside the common.js
in my common I have
function checkForm()
{
var x=document.myform;
var error=””;

function isInteger(number)
{
var i;
for (i = 0; i < number.length; i++)
{
// Check that current character is number.
var c = number.charAt(i);
if (((c < “0”) || (c > “9”))) return false;
}
return true;

var university_ID=x.uNumber.value;
if(isblank(university_ID)||(university_ID.length!=10)||!isInteger(university_ID))
error+= “Please fill in 10 digits for “University No”.n”
}
….?

}

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@sohguanhNov 26.2010 — You just make sure when you link them in, common.js is loaded first before one.js and two.js should be ok. I think browser load JavaScript code in the sequential order you code inside your <head> tag.

Please correct me if I'm wrong.
×

Success!

Help @HJC 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.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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