<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?
<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?
i guess that the key cannot start with a number. try;
<script>
var tids = {
n308: 1,
n312: 1,
n313: 1,
n314: 1
};
</script>
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:
I have tried in both IE and FF and the code is fine. It should be the error of other codes.
Please use Firefox Web Developer and Firebug to find the source of error.