pass a js variable from one function to another

How cn I pass a variable from one js function to another without declaring it global?

I need to pass a variable created in a function to:

function loadXMLDoc()
robrodpAsked:
Who is Participating?
 
GaryCommented:
If you are calling that function from the other function then just pass it

function somefunction(){
myvar=1
loadXMLDoc(myvar) 
}

function loadXMLDoc(myvar) {
...
}

Open in new window

0
 
robrodpAuthor Commented:
I thought so... thx Gary.

You are the real McCoy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.