hi,
I have written a small script that will display data in a div tag ...the data to be displayed will change every two seconds.
The problem that i am having with this script is that,
in internet explorer i get an error "expected )" [This error does not occur every time i run the script.say once in every 5 runs it appears. Try refreshing the page again and again].
in firefox, nothing gets displayed...i am stumped on that!!
The code :
var names;
var i = 0;
function displaynames(na me)
{
names = name.split("### ");
heading.style.v isibility="visi ble";
heading.style.d isplay = "block";
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
function shownames()
{
if (i<names.length )
{
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
else
{
i=0;
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
The input to displaynames is in this format -> "wow###yipe e"
any help would be appreciated...
thanks,
gomzi.
I have written a small script that will display data in a div tag ...the data to be displayed will change every two seconds.
The problem that i am having with this script is that,
in internet explorer i get an error "expected )" [This error does not occur every time i run the script.say once in every 5 runs it appears. Try refreshing the page again and again].
in firefox, nothing gets displayed...i am stumped on that!!
The code :
var names;
var i = 0;
function displaynames(na me)
{
names = name.split("### ");
heading.style.v isibility="visi ble";
heading.style.d isplay = "block";
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
function shownames()
{
if (i<names.length )
{
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
else
{
i=0;
heading.innerTe xt = names[i];
i=i+1;
var t = setTimeout('sho wnames()',2000) ;
}
The input to displaynames is in this format -> "wow###yipe e"
any help would be appreciated...
thanks,
gomzi.
Comment