DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
  • Legacy
    • can-ejs
    • can-list
    • can-map
      • prototype
        • DEFAULT-ATTR
        • attr
        • bind
        • compute
        • each
        • removeAttr
        • serialize
        • unbind
      • static
        • keys
    • can-map-backup
    • can-map-define
    • can-view-href
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Legacy
  • /
  • can-map
  • /
  • serialize
  • / On this page
    • serialize

      function

      Serialize this object to something that can be passed to JSON.stringify.

      • source

      map.serialize()

      Get the serialized Object form of the map. Serialized data is typically used to send back to a server.

      o.serialize() //-> { name: 'Justin' }
      

      Serialize currently returns the same data as [can.Map.prototype.attrs]. However, in future versions, serialize will be able to return serialized data similar to [can.Model]. The following will work:

      new Map({time: new Date()})
          .serialize() //-> { time: 1319666613663 }
      

      Returns

      {Object}:

      a JavaScript Object that can be serialized with JSON.stringify or other methods.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.