<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Script%3AJson.js</id>
		<title>Script:Json.js - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Script%3AJson.js"/>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;action=history"/>
		<updated>2026-05-13T19:48:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=905&amp;oldid=prev</id>
		<title>Apollolux: lowercase title</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=905&amp;oldid=prev"/>
				<updated>2013-06-24T22:29:06Z</updated>
		
		<summary type="html">&lt;p&gt;lowercase title&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:29, 24 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{lowercase title}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;JSON, which stands for [http://json.org JavaScript Object Notation], is more compact, less-process intensive alternative to XML. It's a way to store complex data objects and restore them back to their original state, similar to PHP's or Java's serialization. What does this mean to Sphere? JSON can be used to save monster stats or complex event states in a way that which doesn't involve creating custom routines to save various attributes to a comma-delimited file. The current version of the JavaScript-based JSON parser is named json2.js and while it retains the original API it boasts significant improvements in speed and efficiency.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;JSON, which stands for [http://json.org JavaScript Object Notation], is more compact, less-process intensive alternative to XML. It's a way to store complex data objects and restore them back to their original state, similar to PHP's or Java's serialization. What does this mean to Sphere? JSON can be used to save monster stats or complex event states in a way that which doesn't involve creating custom routines to save various attributes to a comma-delimited file. The current version of the JavaScript-based JSON parser is named json2.js and while it retains the original API it boasts significant improvements in speed and efficiency.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=728&amp;oldid=prev</id>
		<title>Apollolux: /* Download */ typo</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=728&amp;oldid=prev"/>
				<updated>2013-06-08T00:02:26Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Download: &lt;/span&gt; typo&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 00:02, 8 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Download==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Download==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;JSON parsing is built into [http://www.ecma-international.org/publications/standards/Ecma-262.htm &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;EMCAScript &lt;/del&gt;since 2007] but for JS engines that don't natively support it you can get a script from [http://json.org json.org], specifically [https://github.com/douglascrockford/JSON-js here].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;JSON parsing is built into [http://www.ecma-international.org/publications/standards/Ecma-262.htm &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ECMAScript &lt;/ins&gt;since 2007] but for JS engines that don't natively support it you can get a script from [http://json.org json.org], specifically [https://github.com/douglascrockford/JSON-js here].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=666&amp;oldid=prev</id>
		<title>Apollolux: created from http://web.archive.org/web/20100621060813/http://www.spheredev.org/wiki/Json.js</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Script:Json.js&amp;diff=666&amp;oldid=prev"/>
				<updated>2013-06-03T23:29:40Z</updated>
		
		<summary type="html">&lt;p&gt;created from http://web.archive.org/web/20100621060813/http://www.spheredev.org/wiki/Json.js&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;JSON, which stands for [http://json.org JavaScript Object Notation], is more compact, less-process intensive alternative to XML. It's a way to store complex data objects and restore them back to their original state, similar to PHP's or Java's serialization. What does this mean to Sphere? JSON can be used to save monster stats or complex event states in a way that which doesn't involve creating custom routines to save various attributes to a comma-delimited file. The current version of the JavaScript-based JSON parser is named json2.js and while it retains the original API it boasts significant improvements in speed and efficiency.&lt;br /&gt;
&lt;br /&gt;
What json2.js does is it installs additional methods to the JavaScript primitive types such as Object and Number which allow any object to be rendered down into a JSON string or vice-versa.&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
JSON parsing is built into [http://www.ecma-international.org/publications/standards/Ecma-262.htm EMCAScript since 2007] but for JS engines that don't natively support it you can get a script from [http://json.org json.org], specifically [https://github.com/douglascrockford/JSON-js here].&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Including json2.js in your game will provide a global &amp;quot;JSON&amp;quot; object with two static methods.&lt;br /&gt;
&lt;br /&gt;
*	'''JSON.stringify'''(''value[, replacer, space]'') - Converts &amp;lt;var&amp;gt;value&amp;lt;/var&amp;gt; into a JSON string. &amp;lt;var&amp;gt;replacer&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;space&amp;lt;/var&amp;gt; are optional: they handle how objects without a toJSON() method are dealt with, and how the text is indented, respectively. See the file itself for details.&lt;br /&gt;
*	'''JSON.parse'''(''text[, reviver]'') - Converts the JSON string &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; back into a JavaScript object. The optional &amp;lt;var&amp;gt;reviver&amp;lt;/var&amp;gt; parameter is a function that can transform, replace or remove each key-value pair as it is encountered. See the file itself for details.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function Monster()&lt;br /&gt;
{&lt;br /&gt;
   this.fight = function ( who )&lt;br /&gt;
   {&lt;br /&gt;
      //do some fighting&lt;br /&gt;
   };&lt;br /&gt;
 &lt;br /&gt;
   this.magic = function ( who )&lt;br /&gt;
   {&lt;br /&gt;
      //hocus-pocus&lt;br /&gt;
   };&lt;br /&gt;
 &lt;br /&gt;
   this.loadStats( str )&lt;br /&gt;
   {&lt;br /&gt;
      // take the json string, create an object and apply it to myself&lt;br /&gt;
      json = JSON.parse(str);&lt;br /&gt;
      for (prop in json)&lt;br /&gt;
      {&lt;br /&gt;
         this[prop] = json[prop];&lt;br /&gt;
      }&lt;br /&gt;
   };&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
// create an instance of a monster&lt;br /&gt;
var slime = new Monster();&lt;br /&gt;
slime.hp = 10;&lt;br /&gt;
slime.mp = 2;&lt;br /&gt;
slime.str = 2;&lt;br /&gt;
slime.magic = ['Hurt','Heal','Heal More'];&lt;br /&gt;
slime.exp = 3;&lt;br /&gt;
slime.name = &amp;quot;Green Slime&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
// save the stats of the slime&lt;br /&gt;
jsonslime = slime.toJSONString();&lt;br /&gt;
jsonslime = JSON.stringify(slime);&lt;br /&gt;
 &lt;br /&gt;
// kill it&lt;br /&gt;
delete slime;&lt;br /&gt;
 &lt;br /&gt;
// resurrect it&lt;br /&gt;
var slime = new Monster();&lt;br /&gt;
slime.loadStats(jsonslime);&lt;br /&gt;
 &lt;br /&gt;
// I'm back!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;/div&gt;</summary>
		<author><name>Apollolux</name></author>	</entry>

	</feed>