--- Philip Chee <[EMAIL PROTECTED]> wrote:
> On Thu, 2 Mar 2006 18:26:27 -0800 (PST), Eric H. Jung wrote: > > > Has anyone successfully used JSON (http://www.json.org/json.js) with a > > Firefox/Mozilla > extension? > > It's a means to de/serialize (un/marshall) objects, in same vein as XML or > > RDF > de/serialization. > > > The following works in an HTML page opened in Firefox, but not in an > > extension: > > > function MyClass() { > > this.foo = "foo"; > > } > > alert(JSON.stringify(new MyClass())); > > You don't say what errors you are getting in the JS console. I may be a > Slan, but I've just shampooed my hair and my telepathic tendrils are still > drying out, so I can't read your mind at the moment. No error--just null is alerted. But on an HTML page, "{"foo":"foo"}" is alerted. JSON documentation says it returns null to signify an error. > > Also what does typeof (new MyClass()) return in a HTML page, and from a > chrome script? They both return "object" Discouraged, Eric > > Phil > -- > Philip Chee <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > http://flashblock.mozdev.org/ http://xsidebar.mozdev.org > Guard us from the she-wolf and the wolf, and guard us from the thief, > oh Night, and so be good for us to pass. > [ ]If it works, rip it apart and find out why! > * TagZilla 0.059 > _______________________________________________ > Project_owners mailing list > [email protected] > http://mozdev.org/mailman/listinfo/project_owners > _______________________________________________ Project_owners mailing list [email protected] http://mozdev.org/mailman/listinfo/project_owners
