<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: [sharing is fun] example: write and read JSON in javascript</title>
		<atom:link href="http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 08:44:46 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-57316</guid>
					<title><![CDATA[[sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-57316</link>
					<pubDate>Thu, 26 May 2011 21:26:00 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>I searched around on the forum for this stuff, and managed to gather the necessary stuff for a complete example. Thanks to Adam Murray for the pointer to the main ingredient!<br />
The attached zip file has the js and maxpat that demonstrate how to populate an object in javascript with some stuff (I have it stored in colls, initially) then turn that into a JSON file, then read that JSON file to repopulate your object in the js at a later date.<br />
I&#8217;m curious if there&#8217;s a way to break out the actual parsing functions into a separate file that I could include somehow. I would like this parser to be available to several scripts, but I&#8217;d rather not cut and paste it into every one!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205333</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205333</link>
					<pubDate>Thu, 26 May 2011 22:51:54 +0000</pubDate>
					<dc:creator>Luke Hall</dc:creator>

					<description>
						<![CDATA[
						<p>Check out the jsextensions file which can hold functions you can call from any other javascript you want.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205334</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205334</link>
					<pubDate>Fri, 27 May 2011 00:45:49 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>Oh, hang, that&#8217;s too easy! Thanks for the tip.<br />
Peter</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205335</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205335</link>
					<pubDate>Fri, 27 May 2011 03:47:01 +0000</pubDate>
					<dc:creator>oli larkin</dc:creator>

					<description>
						<![CDATA[
						<p>Json is great. I have done a similar thing here <a href="http://cycling74.com/forums/topic.php?id=33596" rel="nofollow">http://cycling74.com/forums/topic.php?id=33596</a></p>
<p>I hope max6&#8242;s js engine gets updated. Lots of interesting stuff going on with js at the moment (e.g node.js) and it would be cool to be able to #include files using require() </p>
<p><a href="http://www.olilarkin.co.uk" rel="nofollow">http://www.olilarkin.co.uk</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205336</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205336</link>
					<pubDate>Mon, 30 May 2011 13:01:28 +0000</pubDate>
					<dc:creator>orange_glass</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for posting this, it&#8217;s really helped me out.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205337</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205337</link>
					<pubDate>Mon, 30 May 2011 17:53:44 +0000</pubDate>
					<dc:creator>Luke Hall</dc:creator>

					<description>
						<![CDATA[
						<p>You can use <code>eval()</code> to include other javascript files if you want. Although this comes with problem of making sure the file you&#8217;re including contains no errors because <code>eval()</code> will load it in as-is. Here&#8217;s an example of some code I load in to jsextensions that will make this easier, <a href="http://hallluke.wordpress.com/2010/10/31/including-extra-javascript-files/">go take a look</a>.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205338</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205338</link>
					<pubDate>Mon, 30 May 2011 21:47:54 +0000</pubDate>
					<dc:creator>orange_glass</dc:creator>

					<description>
						<![CDATA[
						<p>One thing I&#8217;ve noticed with the<br />
 var fout = new File(path,&#8221;write&#8221;,&#8221;TEXT&#8221;); </p>
<p>line is if my file was once larger than the JSON output is currently, the old extra contents are still at the bottom of the file.</p>
<p>Is there anyway to zero out the file beforehand?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205339</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205339</link>
					<pubDate>Tue, 31 May 2011 07:55:16 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>I think you can set the end of file:</p>
<pre><code>var fout = new File(path, "write", "TEXT");
fout.eof = 0;
// ... write your stuff</code></pre>						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205400</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205400</link>
					<pubDate>Tue, 31 May 2011 07:55:16 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>I think you can set the end of file:</p>
<pre><code>var fout = new File(path, "write", "TEXT");
fout.eof = 0;
// ... write your stuff</code></pre>						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205340</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205340</link>
					<pubDate>Tue, 31 May 2011 18:21:59 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>Glad you caught that. I think it&#8217;s<br />
<code>fout.eof = 0</code></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205404</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205404</link>
					<pubDate>Tue, 31 May 2011 18:21:59 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>Glad you caught that. I think it&#8217;s<br />
<code>fout.eof = 0</code></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205341</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205341</link>
					<pubDate>Tue, 31 May 2011 22:36:58 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>Of course Peter. Thanks for mentioning it, I fixed my previous post.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205405</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205405</link>
					<pubDate>Tue, 31 May 2011 22:36:58 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>Of course Peter. Thanks for mentioning it, I fixed my previous post.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205342</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205342</link>
					<pubDate>Wed, 01 Jun 2011 17:09:14 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>And thanks for posting it. I was actually in the midst of suffering the problem when I happened to check back to this post, and there was the solution! I suppose that is a disadvantage of posting a zip file, as that bug is embedded in eternity up there. Well, for the sake of the archive, here&#8217;s a fixed version</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205408</guid>
					<title><![CDATA[Re: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-205408</link>
					<pubDate>Wed, 01 Jun 2011 17:09:14 +0000</pubDate>
					<dc:creator>Peter Nyboer</dc:creator>

					<description>
						<![CDATA[
						<p>And thanks for posting it. I was actually in the midst of suffering the problem when I happened to check back to this post, and there was the solution! I suppose that is a disadvantage of posting a zip file, as that bug is embedded in eternity up there. Well, for the sake of the archive, here&#8217;s a fixed version</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-252514</guid>
					<title><![CDATA[Reply To: [sharing is fun] example: write and read JSON in javascript]]></title>
					<link>http://cycling74.com/forums/topic/sharing-is-fun-example-write-and-read-json-in-javascript/#post-252514</link>
					<pubDate>Wed, 12 Jun 2013 14:14:05 +0000</pubDate>
					<dc:creator>jic</dc:creator>

					<description>
						<![CDATA[
						<p>Thank you for writing this! It has been immensely helpful in a project I&#8217;ve been working on for a while now. </p>
<p>This morning I was testing saving out very large JS objects (Around 10000 key/value pairs in about 10 levels of depth) and it is truncating the JSON file pretty severely (at around 2000 entries). </p>
<p>I&#8217;ve started an attempt at debugging this but was hoping someone could offer some insight. Thanks.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

