Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

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()
0
robrodp
Asked:
robrodp
1 Solution
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now