Hello,
I have got a problem with this simple javascript that works on every browser I tested but not on AIR (1.5.0 on Aptana Studio) :
<html>
<head>
<title>Test</title>
<script type="text/javascript">
function init()
{
display();
}
var nb=10;
function del()
{
nb--;
display();
}
function display()
{
var i;
var res = "";
for (i=0; i<nb; i++)
{
res += "<li><a onclick=\"del();\">link"+ i +"</a></li>";
}
document.getElementById("results").innerHTML = "<ul>"+ res +"</ul>";
}
</script>
</head>
<body onload="init()">
<p onclick="del()">test</p>
<div id="results"></div>
</body>
</html>
Clicking on any link in the list should reload this list with one item less, but it only works once, I do not understand why considering this code perfectly works on any browser.
Clicking on the "test" text in the <p> also works perfectly and I have got no error message in the console, so what is the problem, please?
Thanks for your help.
I have got a problem with this simple javascript that works on every browser I tested but not on AIR (1.5.0 on Aptana Studio) :
<html>
<head>
<title>Test</title>
<script type="text/javascript">
function init()
{
display();
}
var nb=10;
function del()
{
nb--;
display();
}
function display()
{
var i;
var res = "";
for (i=0; i<nb; i++)
{
res += "<li><a onclick=\"del();\">link"+ i +"</a></li>";
}
document.getElementById("results").innerHTML = "<ul>"+ res +"</ul>";
}
</script>
</head>
<body onload="init()">
<p onclick="del()">test</p>
<div id="results"></div>
</body>
</html>
Clicking on any link in the list should reload this list with one item less, but it only works once, I do not understand why considering this code perfectly works on any browser.
Clicking on the "test" text in the <p> also works perfectly and I have got no error message in the console, so what is the problem, please?
Thanks for your help.