Timeout with Java script
Aug 29, 2010 18:43:43 GMT -5
Post by marcioc on Aug 29, 2010 18:43:43 GMT -5
who knows why this works:
and this does not work?
Thanks in advance.
cls
link #q,"aaa",[test]
html "<script type=""text/javascript"">
var a = null;
var timer;
var as = document.getElementsByTagName('A');
for (var i = 0; i < as.length; i++)
{
if (as.firstChild.data == 'aaa')
{
a = as;
break;
}
}
if (a) timer = setTimeout('location = a.href',500);
</script>"
wait
[test]
cls
print "Worked"
and this does not work?
cls
link #q,"aaa",[test]
html "<script type=""text/javascript""> function inform() {
var a = null;
var timer;
var as = document.getElementsByTagName('A');
for (var i = 0; i < as.length; i++)
{
if (as.firstChild.data == 'aaa')
{
a = as;
break;
}
}
if (a) timer = setTimeout('location = a.href',500);} </script>"
html "<form> <input type='button' name='testx' value='Click me' onclick='inform()'> </form>"
wait
[test]
cls
print "Worked"
Thanks in advance.