title: JSON structure not working in IE7 (JavaScript)
body: <p>OK, I'm new to JSON so please forgive me if my question is a little ignorant - I've beat my head against the wall too much and need some expert advice.</p>
  
  <p>I'm trying to get a simple example working where an HTML page uses jQuery's JSON/AJAX functions to make a call to an example PHP page which passes back a simple JSON data structure and then the page uses jQuery to write one of the elements from the data structure to the page.  Works in FF.  Doesn't work in IE7 arrrggghhhh!</p>
  
  <p>HTML Code (relevant parts):</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
  function testAJAX() {
    $.getJSON("test-ajax.php", function(json){
        $("#div1").html(json.var1[1]);
    });
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input type="button" value="test ajax" onclick="testAJAX();" /&gt;
  &lt;div id="div1"&gt; &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>PHP Code (test-ajax.php):</p>
  
  <pre><code>&lt;?php
  include_once('./json.php'); 
  $output = array('var1' =&gt; array('value1a', 'value1b', 'value1c'), 
                  'var2' =&gt; array('value2a', 'value2b', 'value2c')); 
  
  header("Content-type: text/plain");
  echo json_encode($output);
  ?&gt;
  </code></pre>
  
  <p>json.php has the json_encode() function I'm using - I got it from <a href="http://us2.php.net/manual/en/function.json-encode.php" rel="nofollow noreferrer">http://us2.php.net/manual/en/function.json-encode.php</a>.  I'm using it because I don't have PHP5 and my sys admins won't install any support for it.  Just viewing test-ajax.php directly in your browser prints a serialized JSON structure like this:</p>
  
  <pre><code>{"var1":["value1a","value1b","value1c"],"var2":["value2a","value2b","value2c"]}
  </code></pre>
  
  <p>which appears to be a valid JSON structure.  In my JavaScript I'm trying to reference <code>'value1b'</code> by doing this: <code>json.var1[1]</code>.  FF handles this just fine.  IE7 says that is undefined.</p>
  
  <p>What am I doing wrong?  How do I take transfer a 2-d array like this</p>
  
  <pre><code>array('var1' =&gt; array('value1a', 'value1b', 'value1c'), 
        'var2' =&gt; array('value2a', 'value2b', 'value2c'));
  </code></pre>
  
  <p>over JSON/AJAX?  Or is this not possible?</p>