|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how do I use variable defined globally in function
var InclusionCount = 1;
var ExclusionCount = 1; var PreqCount = 1; I have avbove variables defined globally (in the begining of a javascript just the way they are displayed here ) I am assigning some javleu say 5 to InclusionCount in fucnction five() ( checkked with aler the new value is now 5) and want to use this value i.e the new value in another fucntion. When I give alert fucntion the value becomes 1 (one) How do I solve this problem Please please help |
|
#2
|
|||
|
|||
|
RE: how do I use variable defined globally in function
this should work..
Code:
var blah = 1;
function one() {
blah = 3;
}
funciton two() {
alert(blah);
}
one();
two();
the trick is NOT to declare your global vars in your functions with var blah; |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > how do I use variable defined globally in function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|