<script>
var tids = {
308: 1,
312: 1,
313: 1,
314: 1
};
</script>
results in "missing } in XML expression with an arrow pointing to the first colon in the JS error console. Isn't this a valid declaration?
First you should fix your <script> tag to
<script type="text/javascript">
Next, if you want to use numeric indexes, try to declare them as a string:
var tids = {
'308': 1,
'312': 1,
'313': 1,
'314': 1
};
Please note, however, that you will not be able to reference them in object notation (i.e. tids.308). You could simply use arrays instead of objects:
This isn't an associative array -- it's just a JS object. I believe you need to make the keys strings instead of numeric.
var tids = {
"308": 1,
"312": 1,
"313": 1,
"314": 1
};
More info on associative arrays vs. regular objects.
i guess that the key cannot start with a number. try;
<script>
var tids = {
n308: 1,
n312: 1,
n313: 1,
n314: 1
};
</script>
<script type='text/javascript' language='javascript'>? Might help if your browser is confused for some reason...