> The JSON file is at http://members.chello.at/stephen.joung/testsite/
> test10.json
> in case you would like to check it.
IE has a funny feature called conditional compilation in its Jscript
engine. It is a set of directives which begin with @-symbols which
allow the JIT compilation of certain segments of Javascript to be
suppressed based on particular conditions. That is, these bits of
code will be ignored. Similar to pre-processor instructions for C
compilers.
Your JSON file includes "@xmlns" and "@currency". Although these are
not conditional compilation directives, they are valid conditional
compilation variable names. Now, I'm no expert on IE's Jscript
engine, but I believe that your "look" function tries to access
properties using the obj.prop syntax, rather than obj["prop"]. In the
case of the properties "@xmlns" and "@currency", IE interprets that
as an attempt to use conditional compilation, but as you've not
switched conditional compilation on (using the "@cc_on" directive),
this fails. The solution would be to use obj["prop"] syntax in look.
To be honest, Firefox should complain too, because I'm pretty sure
that the obj.prop syntax is illegal unless the property name is a
valid ECMAScript token name, which I believe "@xmlns" is not.
--
Toby A Inkster
<mailto:ma...@tobyinkster.co.uk>
<http://tobyinkster.co.uk>