Permalink
Browse files

Changed JSON - array to render columns instead of rows.

Turned on analytics
  • Loading branch information...
1 parent b5947ed commit 8d8ef541aaa1d5cf7e0083e701cc746cb2dd2616 Shan Carter committed Oct 2, 2010
Showing with 8 additions and 10 deletions.
  1. +2 −3 index.html
  2. +6 −7 js/converter.js
View
@@ -25,7 +25,7 @@
<div id='header'>
<div id="description">
<h1>Mr. Data Converter</h1>
- <p>I will convert your Excel data for you into one of several web-friendly formats, include JSON and XML.</p>
+ <p>I will convert your Excel data for you into one of several web-friendly formats, including HTML, JSON and XML.</p>
<p>If you don't want the values of a column to be quoted in the output, append ":number" to the header for that column. Example: "NUM_ORANGES:number".</p>
<p>Comments or problems? Email me at <a href="mailto:mr.dataconverter@gmail.com?Subject=Suggestions">mr.dataconverter@gmail.com</a>. For updates, follow me on Twitter: <a href="https://twitter.com/mrdataconverter">@mrdataconverter</a>. I'm also on <a href="http://github.com/shancarter/Mr-Data-Converter">github</a>, if that sort of thing means anything to you.</p>
</div>
@@ -144,14 +144,13 @@
</script>
- <!--
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1923845-1";
urchinTracker();
</script>
- -->
+
</body>
</html>
View
@@ -19,7 +19,7 @@ function DataConverter(nodeId) {
{"text":"ASP/VBScript","id":"asp"},
{"text":"HTML", "id":"html"},
{"text":"JSON - Properties","id":"json"},
- {"text":"JSON - Array","id":"jsonArray"},
+ {"text":"JSON - Arrays","id":"jsonArray"},
{"text":"PHP","id":"php"},
{"text":"Ruby","id":"ruby"},
{"text":"XML - Properties","id":"xmlProperties"},
@@ -329,14 +329,13 @@ DataConverter.prototype.convert = function() {
//JSON - array
} else if (this.outputDataType === "jsonArray") {
this.outputText += "[";
- for (var i=0; i < numRows; i++) {
- var row = dataArray[i];
+ for (var i=0; i < numColumns; i++) {
this.outputText += "[";
- for (var j=0; j < numColumns; j++) {
- if (headerTypes[j] == "number") {
- this.outputText += row[j];
+ for (var j=0; j < numRows; j++) {
+ if (headerTypes[i] == "number") {
+ this.outputText += dataArray[j][i];
} else {
- this.outputText += '"'+row[j]+'"' ;
+ this.outputText += '"'+dataArray[j][i]+'"' ;
}

0 comments on commit 8d8ef54

Please sign in to comment.