<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>innerHTML</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>How can I dynamically create a new javascript
variable that will be available to subsequent scripts.</FONT></DIV>
<DIV><FONT face=Arial size=2>I can use eval("var newvar;newvar=33;") to create
the variable, but the new variable only seems to exist within the scope of the
script block that it was created in. Below is a page that demonstrates what I
mean... the first alert works, the second one says that newvar is
undefined.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2><html><head></head><body><BR><A HREF=#
onclick='Javascript:eval("var newvar;newvar=33;");alert(newvar);'>create
variable "newvar"</A><BR><BR><A HREF=#
onclick='Javascript:alert("newvar="+newvar);'>view
"newvar"</A><BR></body></html></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance</FONT></DIV>
<DIV><FONT face=Arial size=2>Lau</FONT></DIV></BODY></HTML>