T
Thierry Loiseau
Hello all,
and Happy end year 2005 !
Well, I would like to obtain a list of all JavaScript var statement,
With "for...in" perharps ?
That is bellow my recent test here, but the problem is to management
theses :-((( I must to declare and use all variable with this scheme :
v['name']
Thanx for all suggestion !
========================================================================
<html>
<head>
<title>for...in (var)</title>
</head>
<body>
<script type="text/javascript">
<!--
var v=new Array();
v['titi']="";
v['bleah']='toto';
v['toto']='bibi';
v['tutu']=109;
v['annonce_fr']="Bonne fêtes de fin d'année !";
v['annonce_en']="Happy new year, this is the end of the year 2005...
Hello 2006 !!";
function print_all() {
for (var i in window.v) {
v['titi']=(typeof(window.v)=="string")?" ' ":"";
document.write(i + " = " + v['titi'] +
"<span style='color: blue; font-weight:bold;'>"+window.v+"</span>"
+
v['titi'] + "<br>\n");
}
}
print_all();
document.write("<hr> v['tutu']+2 = "+(v['tutu']+2));
// -->
</script>
</body>
</html>
========================================================================
Thierry
and best regards from France,
<http://www.google.com/maps?ll=45.128319,1.306686&spn=0.005925,0.013087&
t=k&hl=fr>
PS : sorry for my bad english spoken :-(
and Happy end year 2005 !
Well, I would like to obtain a list of all JavaScript var statement,
With "for...in" perharps ?
That is bellow my recent test here, but the problem is to management
theses :-((( I must to declare and use all variable with this scheme :
v['name']
Thanx for all suggestion !
========================================================================
<html>
<head>
<title>for...in (var)</title>
</head>
<body>
<script type="text/javascript">
<!--
var v=new Array();
v['titi']="";
v['bleah']='toto';
v['toto']='bibi';
v['tutu']=109;
v['annonce_fr']="Bonne fêtes de fin d'année !";
v['annonce_en']="Happy new year, this is the end of the year 2005...
Hello 2006 !!";
function print_all() {
for (var i in window.v) {
v['titi']=(typeof(window.v)=="string")?" ' ":"";
document.write(i + " = " + v['titi'] +
"<span style='color: blue; font-weight:bold;'>"+window.v+"</span>"
+
v['titi'] + "<br>\n");
}
}
print_all();
document.write("<hr> v['tutu']+2 = "+(v['tutu']+2));
// -->
</script>
</body>
</html>
========================================================================
Thierry
and best regards from France,
<http://www.google.com/maps?ll=45.128319,1.306686&spn=0.005925,0.013087&
t=k&hl=fr>
PS : sorry for my bad english spoken :-(