Forum Moderators: open
For example:
function some_func(number)
{
var testVariable+number = 5;
}
So lets say the "number" parameter was passed the value 2. I would want the variable "testVariable2" to equal 5. Can I do this or do I have to make an array like:
testVariable[number]
Thanks a lot for your help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function varTest(x){
window[x]="a";
alert(b);
}
</script>
</head>
<body onload="varTest('b');">
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function varTest(x,y){
window[x]="a";var q=window.varTest;
q[y]="c";
alert(q.d);
}
</script>
</head>
<body onload="varTest('b','d');">
<a href="#" onclick="alert(b);">test global</a><br />
<a href="#" onclick="alert(q.d);">test q.local</a><br />
</body>
</html>
var wysiwygEditor = new Array();
wysiwygEditor1 = new FCKeditor( arguments[i] ) ;
wysiwygEditor1.BasePath = 'wysiwyg/' ;
if (! document.all )
wysiwygEditor1.Config['EnableXHTML'] = false ;
wysiwygEditor1.ReplaceTextarea() ;
where "1" was the unique part of the variable. Using an array there didn't work, because there was a bug in the WYSIWYG editor. It's all fixed now and Im using this code:
var wysiwygEditor = new Array();
wysiwygEditor[i] = new FCKeditor( arguments[i] ) ;
wysiwygEditor[i].BasePath = 'wysiwyg/' ;
if (! document.all )
wysiwygEditor[i].Config['EnableXHTML'] = false ;
wysiwygEditor[i].ReplaceTextarea() ;
Thanks a lot for everyone's help.
I believe the production version is 1.6 and version 2 is in its second beta.