title: How to add text to beginning and ending of JSON to make it JSONP
body: <p>I'm working on a project, I can manually add a beginning name and parenthesis: bio( 
  and an ending ) to the end of my JSON data to make it callable as JSONP.</p>
  
  <p>I am going to do this to about 200 files which is why I'm trying to find a solution to do this in code.</p>
  
  <p>I've tried using regex, converting to a string, trying to convert back, etc, and nothing seems to work.</p>
  
  <p>My abbreviated JSON data is below:</p>
  
  <pre><code>{
  "Directory": {
      "workbooks": ["/xl/workbook.xml"],
      "sheets": ["/xl/worksheets/sheet1.xml"],
      "style": "/xl/styles.xml",
      "defaults": {
          "xml": "application/xml",
          "rels": "application/vnd.openxmlformats-package.relationships+xml"
      }
  },
  "Workbook": {
      "AppVersion": [null],
      "Sheets": [
          [null]
      ],
      "CalcPr": [null],
      "xmlns": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  }
  </code></pre>
  
  <p>What I want is:</p>
  
  <pre><code>bio({  &lt;--------
  "Directory": {
      "workbooks": ["/xl/workbook.xml"],
      "sheets": ["/xl/worksheets/sheet1.xml"],
      "style": "/xl/styles.xml",
      "defaults": {
          "xml": "application/xml",
          "rels": "application/vnd.openxmlformats-package.relationships+xml"
      }
  },
  "Workbook": {
      "AppVersion": [null],
      "Sheets": [
          [null]
      ],
      "CalcPr": [null],
      "xmlns": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  }) &lt;-------
  </code></pre>
  
  <p>I've gotten closest with Stringify and regex:</p>
  
  <pre><code>var myString = JSON.stringify(workbook);
  var change = myString.replace(/^/,"bioInfo(").replace(/$/,")”);
  </code></pre>
  
  <p>When I try to change it back to an object so I can use it though, it fails saying:
   JSON.parse: unexpected character at line 1 column 1 of the JSON data</p>
  
  <p>I've tried eval as well trying to get it to change back to an object but it just doesn't seem to work.</p>
  
  <p>Hopefully my dilemma is clear and someone knows a good way to do this in Javascript or Jquery. </p>
  
  <p>Thanks in advance.</p>