This project is archived and is in readonly mode.

#250 ✓invalid
Nicolas S.

JSON.decode returns error code in IE6

Reported by Nicolas S. | July 22nd, 2008 @ 02:25 PM | in 2.0 (closed)

The decode function of JSON in the 1.2 release throws an error in IE6: it's

waiting for a ')' at the end of the function.

When I replace the line :

if (secure && !(/^[,:{}\[\]0-9.\-+Eaeflnr-u

\n\r\t]*$/).test(string.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '')))

return null;

With :

var reg = new RegExp("^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$");

if (secure && !reg.test(string.replace(/\\./g,

'@').replace(/"[^"\\\n\r]*"/g, ''))) return null;

The problem is solved...

It seems to be a parsing error in IE6 javascript engine when encountering

the Regular Expression but I can't do more testing.

Comments and changes to this ticket

  • Jan Kassens

    Jan Kassens July 22nd, 2008 @ 05:57 PM

    • State changed from “new” to “invalid”
    • Tag set to json.decode
    • Assigned user changed from “Valerio” to “Jan Kassens”

    failing example needed. Probably a syntax error in the json string.

    alert(JSON.decode('[2,3]')); // works
    

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages