I’m writing a javascript slideshow, but Firebug is telling me there’s an error in the syntax, or something, but I just can’t see what’s wrong!
Here’s the code snippet:
<script language="javascript" type="text/javascript">
var data = new Array();
var data[0] = new Array();
var data[0]['id'] = 'example';
var data[0]['height'] = 190;
</script>
Firebug says:
missing ; before statement
var data[0] = new Array();
The problem? Well, I just don’t understand where the problem is!
Could anyone explain the mistake to me?
Thank you!
You can’t declare an array index. Lose the
varon all but the first line.