title: Uncaught SyntaxError: Unexpected end of input While doing JSON.Parse
body: <p>HTML &amp; PHP:</p>
  
  <pre><code>&lt;select id="package"&gt;
      &lt;?php $package_size_array = array('size_a' =&gt; 70, 'size_b' =&gt; 90, 'size_c' =&gt; 130); ?&gt;
      &lt;option value="size" id="&lt;?php echo json_encode($package_size_array, JSON_PRETTY_PRINT); ?&gt;"&gt;Size&lt;/option&gt;
      &lt;!--Some more &lt;option&gt;s here...--&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>$(document).ready(function() {  
      $('select#package').change(function() {
          var id = $(this).children(':selected').attr('id');
          alert(JSON.parse(id)); /* Line 217. in functions.js file */
      });
  });
  </code></pre>
  
  <p>Problem: Chrome and probably other browsers' console prints:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected end of input functions.js:217
  (anonymous function) functions.js:217
  jQuery.event.dispatch jquery.js:4371
  elemData.handle
  </code></pre>