Loading ...
Sorry, an error occurred while loading the content.

351Re:[json] Introduction Date and Function objects to the standard

Expand Messages
  • Fang Yidong
    May 23, 2006
    • 0 Attachment
      I think why JSON be successful as a data-interchange
      format is its simplicity and neutral nature for many
      languages. Adding function definition just make JSON
      stick to javascript. As to the datatype 'Date',you can
      use number or string to represent it.

      --- Mert Sakarya <msakarya@...>:

      > Can we use function definitions in JSON? Eg.
      >
      > {"book": {
      > "name": "bookname",
      > "chapter": [...],
      > "gotoChapter" : function(chapterId) {...}
      > }
      > }
      >
      > And how about using Date objects? Eg.
      >
      > {"book": {
      > "name": "bookname",
      > "chapter": [...],
      > "gotoChapter" : function(chapterId) {...},
      > "printDate" : new Date(2000,06,31,12,11,00)
      > }
      > }
      >
      > The two examples above cannot be parsed, "parse"
      > method on the standard.
      >
      > I think, adding function definitions to the
      > standard, adds great
      > flexibility for javascript, but decreases
      > portability.
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      > --------------------~-->
      > Home is just a click away. Make Yahoo! your home
      > page now.
      >
      http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/1U_rlB/TM
      >
      --------------------------------------------------------------------~->
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      > json-unsubscribe@yahoogroups.com
      >
      >
      >
      >
      >




      ___________________________________________________________
      雅虎免费邮箱-3.5G容量,20M附件
      http://cn.mail.yahoo.com/
    • Show all 18 messages in this topic