title: Handling html code in JSON
body: <p>I am writing code that will use AJAX requests to get some HTML code from the server to embed, but I cannot seem to get the JSON format correct. Can anyone tell me what I am doing wrong?</p>
  
  <pre><code>{"response": 
   [
    {"code": "&lt;div id=\”sponsors\” class=\”infoBox\” &gt; &lt;div class=\”title\”&gt;THANK YOU 2011 SPONSORS!&lt;/div&gt; &lt;div class=\”section\”&gt; &lt;div class=\”party\”&gt;&lt;a href=\”http://www.ChickRussell.com\”&gt;Chick Russell Communications&lt;/a&gt;&lt;/div&gt; &lt;div class=\”cityState\”&gt;Pasadena, California&lt;/div&gt; &lt;div class=\”description\”&gt; Chick Russell Communications is a story-driven creative development company, not a design-driven company. It's one of our main distinguishing features. It doesn't matter how great it looks if it doesn't create the desired effect. &lt;a href=\”/vendors/info/17280\”&gt;more...&lt;/a&gt; &lt;/div&gt; &lt;div class=\”web\”&gt;&lt;a href=\”http://www.ChickRussell.com\”&gt;www.ChickRussell.com&lt;/a&gt;&lt;/div&gt; &lt;/div&gt;  &lt;/div&gt;"
    }
   ]
  }
  </code></pre>
  
  <p>When I try to run <code>JSON.parse()</code> on it, I get a syntax error</p>
  
  <p>Here is the code I am using to read the JSON:</p>
  
  <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt;
  var newxhr = new XMLHttpRequest()
  
  newxhr.onreadystatechange = getResponse
  
  function getResponse(){
      if(newxhr.readyState == 4) {
          var response = newxhr.responseText;
  
          console.log(response)
  
          response = JSON.parse(response)
  
          newxhr.close;
      }
  }
  
  var url = "http://*.*.net/test.json";
  
  newxhr.open("GET", url, true);
  newxhr.send(null)
  &lt;/script&gt;
  </code></pre>